__legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 48a066e72d970a3e225a9c18690d570c736fc455 · < 8cafd7266fa02e0863bacbf872fe635c0b9725eb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
__legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock
... or we risk stealing final mntput from sync umount - raising mnt_count after umount(2) has verified that victim is not busy, but before it has set MNT_SYNC_UMOUNT; in that case __legitimize_mnt() doesn't see that it's safe to quietly undo mnt_count increment and leaves dropping the reference to caller, where it'll be a full-blown mntput().
Check under mount_lock is needed; leaving the current one done before taking that makes no sense - it's nowhere near common enough to bother with.
From the CVE record · Linux
A race in the Linux kernel’s __legitimize_mnt() can mishandle a mount reference during a concurrent umount(2). The issue occurs when the reference count is raised after umount(2) checks whether the mount is busy but before it sets MNT_SYNC_UMOUNT; the input does not specify attacker access requirements or a resulting exploit.
Teams running the Linux kernel should check their versions; affected versions are not specified.