netdev
[Top] [All Lists]

Re: TCP crashes when cycling loopback interface.

To: jmorris@xxxxxxxxxx (James Morris)
Subject: Re: TCP crashes when cycling loopback interface.
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 07 Oct 2004 20:30:07 +1000
Cc: netdev@xxxxxxxxxxx
In-reply-to: <Xine.LNX.4.44.0410070200270.2111-100000@xxxxxxxxxxxxxxxxxxxxxxxx>
Organization: Core
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686))
James Morris <jmorris@xxxxxxxxxx> wrote:
> On an FC2 system, kernel 2.6.9-rc3-mm2 (selinux=0), running this causes a 
> often repeatable oopses:

Please apply the foolowing patch and see if it produces a meaningful
back trace.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
===== include/net/tcp.h 1.95 vs edited =====
--- 1.95/include/net/tcp.h      2004-10-04 07:31:39 +10:00
+++ edited/include/net/tcp.h    2004-10-07 20:28:08 +10:00
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 #include <linux/cache.h>
 #include <linux/percpu.h>
+#include <linux/kernel.h>
 #include <net/checksum.h>
 #include <net/sock.h>
 #include <net/snmp.h>
@@ -1174,6 +1175,7 @@
 
 static inline void tcp_inc_pcount(tcp_pcount_t *count, struct sk_buff *skb)
 {
+       WARN_ON(tcp_skb_pcount(skb) == 0);
        count->val += tcp_skb_pcount(skb);
 }
 
@@ -1189,12 +1191,14 @@
 
 static inline void tcp_dec_pcount(tcp_pcount_t *count, struct sk_buff *skb)
 {
+       WARN_ON(tcp_skb_pcount(skb) == 0);
        count->val -= tcp_skb_pcount(skb);
 }
 
 static inline void tcp_dec_pcount_approx(tcp_pcount_t *count,
                                         struct sk_buff *skb)
 {
+       WARN_ON(tcp_skb_pcount(skb) == 0);
        if (count->val) {
                count->val -= tcp_skb_pcount(skb);
                if ((int)count->val < 0)

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