From patchwork Mon Mar 23 10:27:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: FengYu LeiDian X-Patchwork-Id: 453348 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 2F37B140146 for ; Mon, 23 Mar 2015 21:33:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=Loobh2n+; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752404AbbCWKdJ (ORCPT ); Mon, 23 Mar 2015 06:33:09 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36090 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144AbbCWKdG (ORCPT ); Mon, 23 Mar 2015 06:33:06 -0400 Received: by padcy3 with SMTP id cy3so187597376pad.3 for ; Mon, 23 Mar 2015 03:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=OWJHghEegS4sXDYHL/3dnK2UToP/oTwRR0l/m27XRko=; b=Loobh2n+oBJWcmMdjJHK7C14Nh2AKklOcI8CeGC1ppdJZdySaXtAE2r8HVcdnIawPg ZUxBgeH5FCT3aPBWucTFTk8/JBjducC323LvW9oN2Q/tlbN1UUhHxPtvxgca2Rsg/9oE 342JDz8T2x7zChMLH17ubmHiqp6FDVj57oZxjmd+CTDR0P09r05JYZNhljaNNIge3zVD i12mqpuDAq0kWvmdpoasaseTkq1aWfB8MHED+7zM01/afyWejmkuLgzoHu+iv6pwky1K GMg2ADxaHKR147DvINrf6AJVi5lFsMO/h3TXj1Gl9+3T4uJKHUPKM9rs0YFcaCOb8CxI Sl3g== X-Received: by 10.70.125.232 with SMTP id mt8mr152996193pdb.112.1427106786081; Mon, 23 Mar 2015 03:33:06 -0700 (PDT) Received: from [134.191.220.73] ([134.191.220.73]) by mx.google.com with ESMTPSA id vh2sm571428pbc.49.2015.03.23.03.33.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Mar 2015 03:33:05 -0700 (PDT) Message-ID: <550FEA98.3040009@gmail.com> Date: Mon, 23 Mar 2015 18:27:36 +0800 From: Fan Du User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Erik Hugne CC: netdev@vger.kernel.org, Eric Dumazet Subject: Re: tcp_v4_err/request sock refcnt leak? References: <20150323090317.GB8934@haze> In-Reply-To: <20150323090317.GB8934@haze> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 于 2015年03月23日 17:03, Erik Hugne 写道: > I'm hitting this warning on latest net-next when i try to SSH into a machine > with eth0 added to a bridge (but i think the problem is older than that) > > Steps to reproduce: > node2 ~ # brctl addif br0 eth0 > [ 223.758785] device eth0 entered promiscuous mode > node2 ~ # ip link set br0 up > [ 244.503614] br0: port 1(eth0) entered forwarding state > [ 244.505108] br0: port 1(eth0) entered forwarding state > node2 ~ # [ 251.160159] ------------[ cut here ]------------ > [ 251.160831] WARNING: CPU: 0 PID: 3 at include/net/request_sock.h:102 tcp_v4_err+0x6b1/0x720() > [ 251.162077] Modules linked in: > [ 251.162496] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 4.0.0-rc3+ #18 > [ 251.163334] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 > [ 251.164078] ffffffff81a8365c ffff880038a6ba18 ffffffff8162ace4 0000000000009898 > [ 251.165084] 0000000000000000 ffff880038a6ba58 ffffffff8104da85 ffff88003fa437c0 > [ 251.166195] ffff88003fa437c0 ffff88003fa74e00 ffff88003fa43bb8 ffff88003fad99a0 > [ 251.167203] Call Trace: > [ 251.167533] [] dump_stack+0x45/0x57 > [ 251.168206] [] warn_slowpath_common+0x85/0xc0 > [ 251.169239] [] warn_slowpath_null+0x15/0x20 > [ 251.170271] [] tcp_v4_err+0x6b1/0x720 > [ 251.171408] [] ? _raw_read_lock_irq+0x3/0x10 > [ 251.172589] [] ? inet_del_offload+0x40/0x40 > [ 251.173366] [] icmp_socket_deliver+0x65/0xb0 > [ 251.174134] [] icmp_unreach+0xc2/0x280 > [ 251.174820] [] icmp_rcv+0x2bd/0x3a0 > [ 251.175473] [] ip_local_deliver_finish+0x82/0x1e0 > [ 251.176282] [] ip_local_deliver+0x88/0x90 > [ 251.177004] [] ip_rcv_finish+0xf0/0x310 > [ 251.177693] [] ip_rcv+0x2dc/0x390 > [ 251.178336] [] __netif_receive_skb_core+0x713/0xa20 > [ 251.179170] [] __netif_receive_skb+0x1a/0x80 > [ 251.179922] [] process_backlog+0x94/0x120 > [ 251.180639] [] net_rx_action+0x1e2/0x310 > [ 251.181356] [] __do_softirq+0xa7/0x290 > [ 251.182046] [] run_ksoftirqd+0x19/0x30 > [ 251.182726] [] smpboot_thread_fn+0x153/0x1d0 > [ 251.183485] [] ? SyS_setgroups+0x130/0x130 > [ 251.184228] [] kthread+0xee/0x110 > [ 251.184871] [] ? kthread_create_on_node+0x1b0/0x1b0 > [ 251.185690] [] ret_from_fork+0x58/0x90 > [ 251.186385] [] ? kthread_create_on_node+0x1b0/0x1b0 > [ 251.187216] ---[ end trace c947fc7b24e42ea1 ]--- > [ 259.542268] br0: port 1(eth0) entered forwarding state I'm not familiar with this part, IMHO, this might be a double call for reqsk_put? > > node2 ~ # ethtool -i eth0 > driver: virtio_net > version: 1.0.0 > firmware-version: > bus-info: 0000:00:03.0 > supports-statistics: no > supports-test: no > supports-eeprom-access: no > supports-register-dump: no > supports-priv-flags: no > > > Networking seems to recover after i remove eth0 from the bridge. > > //E > -- > 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 25a9615..fd805c0 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -316,7 +316,6 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) * errors returned from accept(). */ inet_csk_reqsk_queue_drop(sk, req); - reqsk_put(req); goto out; case DCCP_REQUESTING: diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 69d8f13..5137ab3 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -174,7 +174,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, } inet_csk_reqsk_queue_drop(sk, req); - reqsk_put(req); goto out; case DCCP_REQUESTING: diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 5554b8f..b1eaf3d 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -487,7 +487,6 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) */ inet_csk_reqsk_queue_drop(sk, req); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); - reqsk_put(req); goto out; case TCP_SYN_SENT: diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 6e3f90d..1d551fa 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -427,7 +427,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, inet_csk_reqsk_queue_drop(sk, req); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); - reqsk_put(req); goto out; case TCP_SYN_SENT: