Skip to content
Commit 5f31c549 authored by Al Viro's avatar Al Viro
Browse files

path_overmount(): avoid false negatives



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.

Reviewed-by: default avatarChristian Brauner <brauner@kernel.org>
Fixes: 26df6034 ("fix automount/automount race properly")
Fixes: 6ac39281 ("fs: allow to mount beneath top mount")
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1f282cdc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment