netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Simon Kirby <sim@hostway.ca>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	David Miller <davem@davemloft.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Jones <davej@redhat.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	Network Development <netdev@vger.kernel.org>,
	Balazs Scheidler <bazsi@balabit.hu>,
	KOVACS Krisztian <hidden@balabit.hu>
Subject: Re: Linux 3.1-rc9
Date: Wed, 02 Nov 2011 23:42:56 +0100	[thread overview]
Message-ID: <4EB1C770.7070605@gmail.com> (raw)
In-Reply-To: <20111102191621.GF5971@hostway.ca>

On 02/11/2011 20:16, Simon Kirby wrote:

 
> Actually, we have an anti-abuse daemon that injects blackhole routes, so
> this makes sense. (The daemon was written before ipsets were merged and
> normal netfilter rules make it fall over under attack.)
> 
> I'll try with this patch. Thanks!
> 


Thanks !

Here is the official submission, please add your 'Tested-by' signature
when you can confirm problem goes away.

(It did here, when I injected random NULL returns from
inet_csk_route_child_sock(), so I am confident this is the problem you hit )

[PATCH] net: add missing bh_unlock_sock() calls

Simon Kirby reported lockdep warnings and following messages :

[104661.897577] huh, entered softirq 3 NET_RX ffffffff81613740
preempt_count 00000101, exited with 00000102?

[104661.923653] huh, entered softirq 3 NET_RX ffffffff81613740
preempt_count 00000101, exited with 00000102?

Problem comes from commit 0e734419
(ipv4: Use inet_csk_route_child_sock() in DCCP and TCP.)

If inet_csk_route_child_sock() returns NULL, we should release socket
lock before freeing it.

Another lock imbalance exists if __inet_inherit_port() returns an error
since commit 093d282321da ( tproxy: fix hash locking issue when using
port redirection in __inet_inherit_port()) a backport is also needed for
>= 2.6.37 kernels.

Reported-by: Dimon Kirby <sim@hostway.ca>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Balazs Scheidler <bazsi@balabit.hu>
CC: KOVACS Krisztian <hidden@balabit.hu>
---
 net/dccp/ipv4.c     |    1 +
 net/ipv4/tcp_ipv4.c |    1 +
 2 files changed, 2 insertions(+)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 332639b..90a919a 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -433,6 +433,7 @@ exit:
 	NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
 	return NULL;
 put_and_exit:
+	bh_unlock_sock(newsk);
 	sock_put(newsk);
 	goto exit;
 }
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0ea10ee..683d97a 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1510,6 +1510,7 @@ exit:
 	NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
 	return NULL;
 put_and_exit:
+	bh_unlock_sock(newsk);
 	sock_put(newsk);
 	goto exit;
 }

  reply	other threads:[~2011-11-02 22:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1318847658.6594.40.camel@twins>
     [not found] ` <CA+55aFxaGKEyhXdHXNxvPrPQ-SGSpbXdfoeXrxfjPx3VXsgvtg@mail.gmail.com>
     [not found]   ` <1318874090.4172.84.camel@twins>
     [not found]     ` <CA+55aFwCBy=4YK6amE=H-BYu9-boj4Po2Zkgf4V261mCx0DC4A@mail.gmail.com>
     [not found]       ` <1318879396.4172.92.camel@twins>
     [not found]         ` <alpine.LFD.2.02.1110172237030.3240@ionos>
     [not found]           ` <alpine.LFD.2.02.1110181037120.3240@ionos>
     [not found]             ` <1318928713.21167.4.camel@twins>
     [not found]               ` <20111018182046.GF1309@hostway.ca>
     [not found]                 ` <alpine.LFD.2.02.1110182146440.3240@ionos>
     [not found]                   ` <20111024190203.GA24410@hostway.ca>
2011-10-25  7:13                     ` Linux 3.1-rc9 Linus Torvalds
2011-10-25  9:01                       ` David Miller
2011-10-25 12:30                         ` Thomas Gleixner
2011-10-25 23:18                           ` David Miller
2011-10-25 20:20                     ` Simon Kirby
2011-10-31 17:32                       ` Simon Kirby
2011-11-02 16:40                         ` Thomas Gleixner
2011-11-02 17:27                           ` Eric Dumazet
2011-11-02 17:46                             ` Linus Torvalds
2011-11-02 17:53                               ` Eric Dumazet
2011-11-02 18:00                                 ` Linus Torvalds
2011-11-02 18:05                                   ` Eric Dumazet
2011-11-02 18:10                                     ` Linus Torvalds
2011-11-02 17:49                             ` Eric Dumazet
2011-11-02 17:58                               ` Eric Dumazet
2011-11-02 19:16                                 ` Simon Kirby
2011-11-02 22:42                                   ` Eric Dumazet [this message]
2011-11-03  0:24                                     ` Thomas Gleixner
2011-11-03  0:52                                     ` Simon Kirby
2011-11-03 22:07                                       ` David Miller
2011-11-03  6:06                                     ` Jörg-Volker Peetz
2011-11-02 17:54                             ` Thomas Gleixner
2011-11-02 18:04                               ` Eric Dumazet
2011-11-02 18:28                           ` Simon Kirby
2011-11-02 18:30                             ` Thomas Gleixner
2011-11-02 22:10                         ` Steven Rostedt
2011-11-02 23:00                           ` Steven Rostedt
2011-11-03  0:09                             ` Simon Kirby
2011-11-03  0:15                               ` Steven Rostedt
2011-11-03  0:17                                 ` Simon Kirby
     [not found] <CA+55aFxPNszU5UHFrDDYnshLEMupaviFwhgEsgmPkqpmuWNZ8A@mail.gmail.com>
     [not found] ` <20111007070842.GA27555@hostway.ca>
     [not found]   ` <20111007174848.GA11011@hostway.ca>
     [not found]     ` <1318010515.398.8.camel@twins>
     [not found]       ` <20111008005035.GC22843@hostway.ca>
     [not found]         ` <1318060551.8395.0.camel@twins>
     [not found]           ` <20111012213555.GC24461@hostway.ca>
2011-10-18  5:40             ` Simon Kirby

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=4EB1C770.7070605@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bazsi@balabit.hu \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hidden@balabit.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sim@hostway.ca \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).