Skip to content

Commit

Permalink
[LLC]: bogus llc packet length
Browse files Browse the repository at this point in the history
discard llc packet which has bogus packet length.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joonwoo Park authored and David S. Miller committed Mar 28, 2008
1 parent 2ba2506 commit 27785d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/llc/llc_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 27785d8

Please sign in to comment.