public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Vineet Agarwal <agarwal.vineet2006@gmail.com>
Cc: Jori Koolstra <jkoolstra@xs4all.nl>,
	brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot <syzbot@syzkaller.appspotmail.com>
Subject: Re: [PATCH] fs/namespace: fix NULL pointer dereference in do_lock_mount()
Date: Wed, 6 May 2026 03:12:30 +0100	[thread overview]
Message-ID: <20260506021230.GJ3518998@ZenIV> (raw)
In-Reply-To: <CA+rjy8fM+8ahj7dcBWjnACU8xBWBqW4ssQFpi68dqRc-F-V3Xg@mail.gmail.com>

On Tue, May 05, 2026 at 11:32:45PM +0530, Vineet Agarwal wrote:
> Hi Jori,
> 
> Thanks for the review.
> 
> >From the syzkaller runs, the NULL dereference in do_lock_mount() is
> reproducible across multiple VMs, which suggests a real race rather than
> a one-off condition.
> 
> The suspected window is between where_to_mount() and inode_lock(). While

Suspected by whom or by what?

> where_to_mount() returns a dentry under mount_locked_reader, that
> protection is dropped before inode_lock() is taken. During this window,
> concurrent mount topology changes (e.g. rename, move_mount, or unmount)
> can occur.

Which of the exits from where_to_mount() has it taken?  And which
of your conditions does it trigger?

> As a result, the dentry obtained from where_to_mount() is not revalidated

"revalidated" in which sense?  "Has that local variable suddenly become
NULL while we hadn't been looking"?

> before use, and may no longer be in a state suitable for inode_lock(),
> leading to the observed NULL pointer dereference.
> 
> I’m still investigating the exact sequence that leads to this, and also
> whether retrying (similar to the existing -EAGAIN path) would be more
> appropriate than the current handling.

Do you have a reproducer?  Which kernel it is and what .config is used?
Incidentally, do the checks in your patch actually trigger on the setup
you are testing?

  parent reply	other threads:[~2026-05-06  2:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  9:51 [PATCH] fs/namespace: fix NULL pointer dereference in do_lock_mount() Vineet Agarwal
2026-05-05 14:43 ` Jori Koolstra
     [not found]   ` <CA+rjy8fM+8ahj7dcBWjnACU8xBWBqW4ssQFpi68dqRc-F-V3Xg@mail.gmail.com>
2026-05-06  2:12     ` Al Viro [this message]
2026-05-06  2:21       ` Al Viro
2026-05-06  4:37         ` Vineet Agarwal

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=20260506021230.GJ3518998@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=agarwal.vineet2006@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jkoolstra@xs4all.nl \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot@syzkaller.appspotmail.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