diff options
Diffstat (limited to 'net/llc/llc_input.c')
-rw-r--r-- | net/llc/llc_input.c | 6 |
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) | |||
117 | skb_pull(skb, llc_len); | 117 | skb_pull(skb, llc_len); |
118 | if (skb->protocol == htons(ETH_P_802_2)) { | 118 | if (skb->protocol == htons(ETH_P_802_2)) { |
119 | __be16 pdulen = eth_hdr(skb)->h_proto; | 119 | __be16 pdulen = eth_hdr(skb)->h_proto; |
120 | u16 data_size = ntohs(pdulen) - llc_len; | 120 | s32 data_size = ntohs(pdulen) - llc_len; |
121 | 121 | ||
122 | if (data_size < 0 || | ||
123 | ((skb_tail_pointer(skb) - | ||
124 | (u8 *)pdu) - llc_len) < data_size) | ||
125 | return 0; | ||
122 | if (unlikely(pskb_trim_rcsum(skb, data_size))) | 126 | if (unlikely(pskb_trim_rcsum(skb, data_size))) |
123 | return 0; | 127 | return 0; |
124 | } | 128 | } |