From: "Bhavik Sachdev" <b.sachdev1904@gmail.com>
To: "Qing Wang" <wangqing7171@gmail.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>,
"Pavel Tikhomirov" <ptikhomirov@virtuozzo.com>,
"Bhavik Sachdev" <b.sachdev1904@gmail.com>,
"Andrei Vagin" <avagin@gmail.com>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<syzbot+9e03a9535ea65f687a44@syzkaller.appspotmail.com>
Subject: Re: [PATCH v3] statmount: Fix the null-ptr-deref in do_statmount()
Date: Fri, 13 Feb 2026 16:40:19 +0530 [thread overview]
Message-ID: <DGDSDKZ6Z5JQ.3QVG4MCX1V7UK@gmail.com> (raw)
In-Reply-To: <20260213103006.2472569-1-wangqing7171@gmail.com>
On Fri Feb 13, 2026 at 4:00 PM IST, Qing Wang wrote:
> If the mount is internal, it's mnt_ns will be MNT_NS_INTERNAL, which is
> defined as ERR_PTR(-EINVAL). So, in the do_statmount(), need to check ns
> of mount by IS_ERR() and return.
>
> Fixes: 0e5032237ee5 ("statmount: accept fd as a parameter")
> Reported-by: syzbot+9e03a9535ea65f687a44@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/698e287a.a70a0220.2c38d7.009e.GAE@google.com/
> Signed-off-by: Qing Wang <wangqing7171@gmail.com>
> ---
> fs/namespace.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index a67cbe42746d..90700df65f0d 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -5678,6 +5678,8 @@ static int do_statmount(struct kstatmount *s, u64 mnt_id, u64 mnt_ns_id,
>
> s->mnt = mnt_file->f_path.mnt;
> ns = real_mount(s->mnt)->mnt_ns;
> + if (IS_ERR(ns))
> + return PTR_ERR(ns);
> if (!ns)
> /*
> * We can't set mount point and mnt_ns_id since we don't have a
Looks good to me.
Reviewed-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
next prev parent reply other threads:[~2026-02-13 11:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 10:30 Qing Wang
2026-02-13 11:10 ` Bhavik Sachdev [this message]
2026-02-14 12:19 ` Christian Brauner
2026-02-16 22:28 ` Andrei Vagin
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=DGDSDKZ6Z5JQ.3QVG4MCX1V7UK@gmail.com \
--to=b.sachdev1904@gmail.com \
--cc=avagin@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ptikhomirov@virtuozzo.com \
--cc=syzbot+9e03a9535ea65f687a44@syzkaller.appspotmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wangqing7171@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®