From patchwork Wed Nov 2 22:42:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 123355 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7A9A3B70B9 for ; Thu, 3 Nov 2011 09:43:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753009Ab1KBWnK (ORCPT ); Wed, 2 Nov 2011 18:43:10 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:52490 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864Ab1KBWnJ (ORCPT ); Wed, 2 Nov 2011 18:43:09 -0400 Received: by wwi36 with SMTP id 36so941605wwi.1 for ; Wed, 02 Nov 2011 15:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=FqOaDWTOcjncRQk0Bm6K4TjnrpoYBfyupShBLl+jnqQ=; b=kfTxAHcb7qzf6UFcOKlU3pe/WgkE7/qEwWTbWJoQw4TCo7vtrAj0rdpdAH/HKPcPdW RbKHMun82WQQWJw8x3VGe0tS2JjBTsYPrRoUcCOW1g68HIk7oghXnuW8uuLgPu4fHO5X GhuiRqHdjPA1cBIe7zGOynHhZTs04G08KWzco= Received: by 10.227.57.147 with SMTP id c19mr8399313wbh.8.1320273787604; Wed, 02 Nov 2011 15:43:07 -0700 (PDT) Received: from [10.150.51.212] (gw0.net.jmsp.net. [212.23.165.14]) by mx.google.com with ESMTPS id e7sm6748463wbh.12.2011.11.02.15.43.00 (version=SSLv3 cipher=OTHER); Wed, 02 Nov 2011 15:43:03 -0700 (PDT) Message-ID: <4EB1C770.7070605@gmail.com> Date: Wed, 02 Nov 2011 23:42:56 +0100 From: Eric Dumazet User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111031 Thunderbird/7.0.1 MIME-Version: 1.0 To: Simon Kirby CC: Thomas Gleixner , David Miller , Peter Zijlstra , Linus Torvalds , Linux Kernel Mailing List , Dave Jones , Martin Schwidefsky , Ingo Molnar , Network Development , Balazs Scheidler , KOVACS Krisztian Subject: Re: Linux 3.1-rc9 References: <1318928713.21167.4.camel@twins> <20111018182046.GF1309@hostway.ca> <20111024190203.GA24410@hostway.ca> <20111025202049.GB25043@hostway.ca> <20111031173246.GA10614@hostway.ca> <1320254854.2292.14.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1320256157.2292.15.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1320256701.2292.19.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <20111102191621.GF5971@hostway.ca> In-Reply-To: <20111102191621.GF5971@hostway.ca> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Eric Dumazet Tested-by: Eric Dumazet CC: Balazs Scheidler CC: KOVACS Krisztian Reviewed-by: Thomas Gleixner Tested-by: Simon Kirby --- net/dccp/ipv4.c | 1 + net/ipv4/tcp_ipv4.c | 1 + 2 files changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }