From: Paul Mackerras Date: Thu, 19 Apr 2007 20:05:52 +0000 (-0700) Subject: [PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet() X-Git-Tag: v2.6.21~35^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5050e3e49f6d89af0d63111611693d9625d1f5;p=linux-2.6 [PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet() From: Paul Mackerras 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 --- diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 933e2f3c77..caabbc408c 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c @@ -802,9 +802,9 @@ process_input_packet(struct asyncppp *ap) /* check for address/control and protocol compression */ p = skb->data; - if (p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { + if (p[0] == PPP_ALLSTATIONS) { /* chop off address/control */ - if (skb->len < 3) + if (p[1] != PPP_UI || skb->len < 3) goto err; p = skb_pull(skb, 2); }