Linux filesystem development
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 2/5] path_overmount(): avoid false negatives
Date: Wed, 4 Jun 2025 09:38:37 +0200	[thread overview]
Message-ID: <20250604-maden-feucht-e97c83f9897f@brauner> (raw)
In-Reply-To: <20250603231709.GB145532@ZenIV>

On Wed, Jun 04, 2025 at 12:17:09AM +0100, Al Viro wrote:
> Holding namespace_sem is enough to make sure that result remains valid.
> It is *not* enough to avoid false negatives from __lookup_mnt().  Mounts
> can be unhashed outside of namespace_sem (stuck children getting detached
> on final mntput() of lazy-umounted mount) and having an unrelated mount
> removed from the hash chain while we traverse it may end up with false
> negative from __lookup_mnt().  We need to sample and recheck the seqlock
> component of mount_lock...
> 
> Bug predates the introduction of path_overmount() - it had come from
> the code in finish_automount() that got abstracted into that helper.
> 
> Fixes: 26df6034fdb2 ("fix automount/automount race properly")
> Fixes: 6ac392815628 ("fs: allow to mount beneath top mount")
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>

  reply	other threads:[~2025-06-04  7:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 23:15 [PATCHES][CFR] vfs fixes Al Viro
2025-06-03 23:16 ` [PATCH 1/5] fs/fhandle.c: fix a race in call of has_locked_children() Al Viro
2025-06-04  7:37   ` Christian Brauner
2025-06-04 11:57   ` Jeff Layton
2025-06-03 23:17 ` [PATCH 2/5] path_overmount(): avoid false negatives Al Viro
2025-06-04  7:38   ` Christian Brauner [this message]
2025-06-03 23:18 ` [PATCH 3/5] finish_automount(): don't leak MNT_LOCKED from parent to child Al Viro
2025-06-04  7:39   ` Christian Brauner
2025-06-03 23:19 ` [PATCH 4/5] fix propagation graph breakage by MOVE_MOUNT_SET_GROUP move_mount(2) Al Viro
2025-06-04  7:39   ` Christian Brauner
2025-06-03 23:20 ` [PATCH 5/5] fs: allow clone_private_mount() for a path on real rootfs Al Viro
2025-06-04  7:40   ` Christian Brauner

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=20250604-maden-feucht-e97c83f9897f@brauner \
    --to=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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