Commit 27785d83 authored by Joonwoo Park's avatar Joonwoo Park Committed by David S. Miller

[LLC]: bogus llc packet length

discard llc packet which has bogus packet length.
Signed-off-by: default avatarJoonwoo Park <joonwpark81@gmail.com>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2ba2506c
...@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb) ...@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
skb_pull(skb, llc_len); skb_pull(skb, llc_len);
if (skb->protocol == htons(ETH_P_802_2)) { if (skb->protocol == htons(ETH_P_802_2)) {
__be16 pdulen = eth_hdr(skb)->h_proto; __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))) if (unlikely(pskb_trim_rcsum(skb, data_size)))
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment