netdev
[Top] [All Lists]

[PATCH] IPv6: Fix BUG When Received Unknown Protocol

To: linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
Subject: [PATCH] IPv6: Fix BUG When Received Unknown Protocol
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Thu, 21 Nov 2002 01:32:03 -0500 (EST)
Cc: davem@xxxxxxxxxx, kuznet@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, usagi@xxxxxxxxxxxxxx
Organization: USAGI Project
Sender: netdev-bounce@xxxxxxxxxxx
Hi,

Since 2.5.43, kernel panics by executing BUG() when
received unknown protocol in IPv6 packet. 
This is because ip6_input_finish() try to kfree_skb() 
while icmpv6_param_prob() has already kfree_skb()'ed the skb.

Thanks.

Patch-Name: Fix BUG When Received Unknown Protocol
Patch-Author: YOSHIFUJI Hideaki / USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
Index: net/ipv6/ip6_input.c
===================================================================
RCS file: /cvsroot/usagi/usagi/kernel/linux25/net/ipv6/ip6_input.c,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -u -r1.1.1.3 -r1.2
--- net/ipv6/ip6_input.c        31 Oct 2002 03:58:27 -0000      1.1.1.3
+++ net/ipv6/ip6_input.c        21 Nov 2002 05:30:59 -0000      1.2
@@ -182,9 +182,10 @@
                if (!raw_sk) {
                        IP6_INC_STATS_BH(Ip6InUnknownProtos);
                        icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
-               } else
+               } else {
                        IP6_INC_STATS_BH(Ip6InDelivers);
-               kfree_skb(skb);
+                       kfree_skb(skb);
+               }
        }
 
        return 0;

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA


<Prev in Thread] Current Thread [Next in Thread>