summaryrefslogtreecommitdiffstats
path: root/net/llc/llc_input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-03 07:35:23 +0200
committerDavid S. Miller <davem@davemloft.net>2008-04-03 07:35:23 +0200
commite1ec1b8ccdf0df6000faa8c2d985ca5f94157e5a (patch)
tree4e1ca325dde22f1ac21c9da0be509e87e922e604 /net/llc/llc_input.c
parent[NETNS]: Do not include net/net_namespace.h from seq_file.h (diff)
parent[VLAN]: Proc entry is not renamed when vlan device name changes. (diff)
downloadlinux-e1ec1b8ccdf0df6000faa8c2d985ca5f94157e5a.tar.xz
linux-e1ec1b8ccdf0df6000faa8c2d985ca5f94157e5a.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/s2io.c
Diffstat (limited to 'net/llc/llc_input.c')
-rw-r--r--net/llc/llc_input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index a69c5c427fe3..1c45f172991e 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
skb_pull(skb, llc_len);
if (skb->protocol == htons(ETH_P_802_2)) {
__be16 pdulen = eth_hdr(skb)->h_proto;
- u16 data_size = ntohs(pdulen) - llc_len;
+ s32 data_size = ntohs(pdulen) - llc_len;
+ if (data_size < 0 ||
+ ((skb_tail_pointer(skb) -
+ (u8 *)pdu) - llc_len) < data_size)
+ return 0;
if (unlikely(pskb_trim_rcsum(skb, data_size)))
return 0;
}