Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	paulmck@linux.vnet.ibm.com,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [2.6.34-rc1] CPU stalls when closing TCP sockets.
Date: Tue, 09 Mar 2010 16:55:56 +0100	[thread overview]
Message-ID: <1268150156.3113.12.camel@edumazet-laptop> (raw)
In-Reply-To: <201003090654.o296sCnh065487@www262.sakura.ne.jp>

Le mardi 09 mars 2010 à 15:54 +0900, Tetsuo Handa a écrit :
> Eric Dumazet wrote:
> > Nothing comes to my mind, I'll try to reproduce this here.
> 
> When stopped at (8), Ctrl-C doesn't work.
> 
> > Is 2.6.33 OK ?
> 
> Yes. 2.6.33 and earlier are OK.

OK thanks !

I believe commit d218d11133d888f9745802146a50255a4781d37a
(tcp: Generalized TTL Security Mechanism) might be the bug origin.

I am testing following patch, based on latest net-2.6 tree (including
the LINUX_MIB_TCPMINTTLDROP bit)

[PATCH] tcp: Fix tcp_v4_rcv()

Commit d218d111 (tcp: Generalized TTL Security Mechanism) added a bug
for TIMEWAIT sockets. We should not test min_ttl for TW sockets.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 8d51d39..70df409 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1651,15 +1651,15 @@ int tcp_v4_rcv(struct sk_buff *skb)
 	if (!sk)
 		goto no_tcp_socket;
 
+process:
+	if (sk->sk_state == TCP_TIME_WAIT)
+		goto do_time_wait;
+
 	if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
 		NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
 		goto discard_and_relse;
 	}
 
-process:
-	if (sk->sk_state == TCP_TIME_WAIT)
-		goto do_time_wait;
-
 	if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb))
 		goto discard_and_relse;
 	nf_reset(skb);



  reply	other threads:[~2010-03-09 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09  3:19 [2.6.34-rc1] CPU stalls when closing TCP sockets Tetsuo Handa
2010-03-09  6:37 ` Eric Dumazet
2010-03-09  6:54   ` Tetsuo Handa
2010-03-09 15:55     ` Eric Dumazet [this message]
2010-03-09 16:22       ` Stephen Hemminger
2010-03-09 18:58       ` Tantilov, Emil S
2010-03-09 21:44       ` Tetsuo Handa
2010-03-10 15:33       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268150156.3113.12.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox