From patchwork Tue Apr 17 12:18:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stanislav Kinsbursky X-Patchwork-Id: 153153 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 A96ADB706F for ; Tue, 17 Apr 2012 22:18:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076Ab2DQMS5 (ORCPT ); Tue, 17 Apr 2012 08:18:57 -0400 Received: from relay.parallels.com ([195.214.232.42]:48398 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755821Ab2DQMS4 convert rfc822-to-8bit (ORCPT ); Tue, 17 Apr 2012 08:18:56 -0400 Received: from msk-exch1.sw.swsoft.com ([10.30.1.231] helo=mail.sw.ru) by relay.parallels.com with esmtps (TLSv1:RC4-MD5:128) (Exim 4.77) (envelope-from ) id 1SK7N1-0007qN-7g; Tue, 17 Apr 2012 16:18:55 +0400 Received: from [10.30.20.35] (10.30.20.35) by mail.sw.ru (10.30.1.231) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 17 Apr 2012 16:18:54 +0400 Message-ID: <4F8D5FAD.10304@parallels.com> Date: Tue, 17 Apr 2012 16:18:53 +0400 From: Stanislav Kinsbursky User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: Simon Kirby CC: Eric Dumazet , "netdev@vger.kernel.org" Subject: Re: 3.3.0, 3.4-rc1 reproducible tun Oops References: <20120404220525.GD21505@hostway.ca> <1333593664.18626.577.camel@edumazet-glaptop> <20120417020852.GA18875@hostway.ca> In-Reply-To: <20120417020852.GA18875@hostway.ca> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 17.04.2012 06:08, Simon Kirby пишет: > On Thu, Apr 05, 2012 at 04:41:04AM +0200, Eric Dumazet wrote: > >> Hmm, is it happening if you remove the nvidia module ? >> >> If yes, please try to add slub_debug=FZPU > > Finally got annoyed enough at this to bisect it. It doesn't happen every > time and I got a bit confused, but I finally tracked it down to: > > 1ab5ecb90cb6a3df1476e052f76a6e8f6511cb3d is the first bad commit > commit 1ab5ecb90cb6a3df1476e052f76a6e8f6511cb3d > Author: Stanislav Kinsbursky > Date: Mon Mar 12 02:59:41 2012 +0000 > > tun: don't hold network namespace by tun sockets > > v3: added previously removed sock_put() to the tun_release() callback, because > sk_release_kernel() doesn't drop the socket reference. > > v2: sk_release_kernel() used for socket release. Dummy tun_release() is > required for sk_release_kernel() ---> sock_release() ---> sock->ops->release() > call. > > TUN was designed to destroy it's socket on network namesapce shutdown. But this > will never happen for persistent device, because it's socket holds network > namespace. > This patch removes of holding network namespace by TUN socket and replaces it > by creating socket in init_net and then changing it's net it to desired one. On > shutdown socket is moved back to init_net prior to final put. > > Signed-off-by: Stanislav Kinsbursky > Signed-off-by: David S. Miller > > ...With this reverted on top of 3.4-rc3, I no longer see crashes when I > keep making and breaking the SSH tunnel while running "vmstat 1" in an > SSH session over a socket that is running through that tunnel. > > Simon- Hi, Simon. Could you please try to apply the patch below on top of your the tree (with 1ab5ecb90cb6a3df1476e052f76a6e8f6511cb3d applied) and check does it fix the problem: --- 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/drivers/net/tun.c b/drivers/net/tun.c index bb8c72c..1fc4622 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1540,13 +1540,10 @@ static int tun_chr_close(struct inode *inode, struct file *file) if (dev->reg_state == NETREG_REGISTERED) unregister_netdevice(dev); rtnl_unlock(); - } + } else + sock_put(tun->socket.sk); } - tun = tfile->tun; - if (tun) - sock_put(tun->socket.sk); - put_net(tfile->net); kfree(tfile);