Commit 5f31c54
Al Viro
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: Christian Brauner <brauner@kernel.org>
Fixes: 26df603 ("fix automount/automount race properly")
Fixes: 6ac3928 ("fs: allow to mount beneath top mount")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent 1f282cd commit 5f31c54
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3478 | 3478 | | |
3479 | 3479 | | |
3480 | 3480 | | |
3481 | | - | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
3482 | 3484 | | |
3483 | 3485 | | |
3484 | 3486 | | |
3485 | 3487 | | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
3486 | 3491 | | |
3487 | | - | |
3488 | | - | |
3489 | | - | |
3490 | | - | |
| 3492 | + | |
3491 | 3493 | | |
3492 | | - | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
3493 | 3500 | | |
3494 | 3501 | | |
3495 | 3502 | | |
| |||
0 commit comments