diff options
author | Paul Mackerras <paulus@samba.org> | 2007-04-19 16:05:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-19 16:05:52 -0400 |
commit | 7c5050e3e49f6d89af0d63111611693d9625d1f5 (patch) | |
tree | 739b5eb674a433077fb3486f7c305ca1720b3215 | |
parent | 895e1fc7226e6732bc77138955b6c7dfa279f57a (diff) |
[PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet()
From: Paul Mackerras <paulus@samba.org>
This fixes:
Subject: kernel BUG at net/core/skbuff.c in linux-2.6.21-rc6
process_input_packet() treats the case where the first byte is 0xff
(PPP_ALLSTATIONS) but the second byte is 0x03 (PPP_UI) as indicating a
packet with a PPP protocol number of 0xff. Arguably that's wrong
since PPP protocol 0xff is reserved, and the RFC does envision the
possibility of receiving frames where the control field has values
other than 0x03.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ppp_async.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 933e2f3c77aa..caabbc408c34 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -802,9 +802,9 @@ process_input_packet(struct asyncppp *ap) | |||
802 | 802 | ||
803 | /* check for address/control and protocol compression */ | 803 | /* check for address/control and protocol compression */ |
804 | p = skb->data; | 804 | p = skb->data; |
805 | if (p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { | 805 | if (p[0] == PPP_ALLSTATIONS) { |
806 | /* chop off address/control */ | 806 | /* chop off address/control */ |
807 | if (skb->len < 3) | 807 | if (p[1] != PPP_UI || skb->len < 3) |
808 | goto err; | 808 | goto err; |
809 | p = skb_pull(skb, 2); | 809 | p = skb_pull(skb, 2); |
810 | } | 810 | } |