Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>,
	syzbot <syzbot+4abac52934a48af5ff19@syzkaller.appspotmail.com>,
	adobriyan@gmail.com, keescook@chromium.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] proc: s_fs_info may be NULL when proc_kill_sb is called
Date: Wed, 10 Jun 2020 18:41:52 +0100	[thread overview]
Message-ID: <20200610174152.GS23230@ZenIV.linux.org.uk> (raw)
In-Reply-To: <87mu5azvxl.fsf@x220.int.ebiederm.org>

On Wed, Jun 10, 2020 at 12:12:54PM -0500, Eric W. Biederman wrote:

> >  {
> >  	struct proc_fs_info *fs_info = proc_sb_info(sb);
> >  
> > -	if (fs_info->proc_self)
> > -		dput(fs_info->proc_self);
> > +	if (fs_info) {
> > +		if (fs_info->proc_self)
> > +			dput(fs_info->proc_self);
> >  
> > -	if (fs_info->proc_thread_self)
> > -		dput(fs_info->proc_thread_self);
> > +		if (fs_info->proc_thread_self)
> > +			dput(fs_info->proc_thread_self);
> > +
> > +		put_pid_ns(fs_info->pid_ns);
> > +		kfree(fs_info);

While we are at it, dput(NULL) is an explicit no-op.

  reply	other threads:[~2020-06-10 17:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 10:56 general protection fault in proc_kill_sb syzbot
2020-06-10 11:23 ` Tetsuo Handa
2020-06-10 11:44   ` Alexey Gladkov
2020-06-10 13:04 ` [PATCH] proc: s_fs_info may be NULL when proc_kill_sb is called Alexey Gladkov
2020-06-10 17:12   ` Eric W. Biederman
2020-06-10 17:41     ` Al Viro [this message]
2020-06-10 18:35   ` [PATCH v2] " Alexey Gladkov
2020-06-10 20:17     ` Eric W. Biederman

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=20200610174152.GS23230@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adobriyan@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=gladkov.alexey@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+4abac52934a48af5ff19@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --subject='Re: [PATCH] proc: s_fs_info may be NULL when proc_kill_sb is called' \
    /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
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).