linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	syzbot+@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com, dvyukov@google.com,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	netdev@vger.kernel.org
Subject: Re: WARNING: refcount bug in should_fail
Date: Mon, 2 Apr 2018 22:52:12 +0100	[thread overview]
Message-ID: <20180402215212.GF30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <87lge5z6yn.fsf@xmission.com>

On Mon, Apr 02, 2018 at 03:30:56PM -0500, Eric W. Biederman wrote:
> Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> writes:

> > I don't think this is a dup of existing bug.
> > We need to fix either 9ee332d99e4d5a97 or d91ee87d8d85a080.
> 
> Even if expanding mount_ns to more filesystems was magically fixed,
> proc would still have this issue with the pid namespace rather than
> the net namespace.
> 
> This is a mess.  I will take a look and see if I can see a a fix.

It's trivially fixable, and there's no need to modify mount_ns() at
all.

All we need is for rpc_kill_sb() to recognize whether we are already
through the point in rpc_fill_super() where the refcount is bumped.
That's it.

The most trivial way to do that is to move
	net = get_net(sb->s_fs_info);
past
        if (!root)
                return -ENOMEM;
in the latter and have
out:
	if (!sb->s_root)
		net = NULL;
        kill_litter_super(sb);
	if (net)
		put_net(net);
in the end of the former.  And similar changes in other affected
instances.

  reply	other threads:[~2018-04-02 21:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <001a113f6736499d1c0566363863@google.com>
2018-03-04  5:57 ` Tetsuo Handa
2018-04-01 10:32   ` Dmitry Vyukov
2018-04-01 10:32     ` syzbot
2018-04-01 10:41       ` Tetsuo Handa
2018-04-02 20:30         ` Eric W. Biederman
2018-04-02 21:52           ` Al Viro [this message]
2018-04-02 21:59             ` Al Viro
2018-04-03  5:20               ` Al Viro
2018-04-03 11:27                 ` Dmitry Vyukov
2018-04-04 15:54                 ` Eric W. Biederman
2018-04-21 10:26                   ` Tetsuo Handa
2018-04-01 10:37     ` Dmitry Vyukov
2018-04-01 11:11       ` Tetsuo Handa
2018-04-01 11:30         ` Dmitry Vyukov
2018-04-01 11:46           ` Dmitry Vyukov
2018-04-01 11:50             ` Dmitry Vyukov

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=20180402215212.GF30522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=dvyukov@google.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=syzbot+@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --subject='Re: WARNING: refcount bug in should_fail' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox