Skip to content

Commit

Permalink
llc: Fix length check in llc_fixup_skb().
Browse files Browse the repository at this point in the history
Fixes bugzilla #32872

The LLC stack pretends to support non-linear skbs but there is a
direct use of skb_tail_pointer() in llc_fixup_skb().

Use pskb_may_pull() to see if data_size bytes remain and can be
accessed linearly in the packet, instead of direct pointer checks.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Apr 12, 2011
1 parent 4a9f65f commit aa86735
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/llc/llc_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
s32 data_size = ntohs(pdulen) - llc_len;

if (data_size < 0 ||
((skb_tail_pointer(skb) -
(u8 *)pdu) - llc_len) < data_size)
!pskb_may_pull(skb, data_size))
return 0;
if (unlikely(pskb_trim_rcsum(skb, data_size)))
return 0;
Expand Down

0 comments on commit aa86735

Please sign in to comment.