CVE-2026-53341: fhandle: fix UAF due to unlocked ->mnt_ns read in may_decode_fh()
In the Linux kernel, the following vulnerability has been resolved:
fhandle: fix UAF due to unlocked ->mntns read in maydecodefh()
maydecodefh() accesses mount::mntns without holding any locks; that means the mount can concurrently be unmounted, and the mntnamespace can concurrently be freed after an RCU grace period.
This race can happens as follows, assuming that the mount point was created by opentree(..., OPENTREECLONE):
thread 1 thread 2 RCU dosysopenbyhandleat dohandleopen handletopath maydecodefh ismounted [mount::mntns access] [mount::mntns access] dosysclose fputclosesync fput dissolveonfput umounttree classnamespaceexcldestructor namespaceunlock freemntns mntnstreeremove callrcu(mntnsreleasercu) mntnsreleasercu mntnsrelease kfree [mntnamespace::userns access] UAF
Fix it by taking rcureadlock() around the mount::mntns access, like in prependpath(). Additionally, document the semantics of mount::mntns, and use WRITEONCE() for writers that can race with lockless readers.
This bug is unreachable unless one of the following is set:
- CONFIGPREEMPTION - CONFIGRCUSTRICTGRACEPERIOD
because it requires an RCU grace period to happen during a syscall without an explicit preemption.
This doesn't seem to have interesting security impact; worst-case, it could leak the result of an integer comparison to userspace (from the level check in capcapable()), cause an endless loop, or crash the kernel by dereferencing an invalid address.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-aws-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1012.12~24.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1014.14~24.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-fde-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1013.13~24.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1011.11~24.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-31.31~24.04.1 - Upgrade
Upgrade
ubuntu/linux-nvidia-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1018.18~24.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1011.11~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-31.31.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-31.31 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1012.12 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 7.0.0-1014.14 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 7.0.0-1013.13 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1011.11 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 7.0.0-1006.7 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1013.13 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 7.0.0-1018.18 - Upgrade
Upgrade
ubuntu/linux-nvidia-bosto a version that resolves this vulnerability.Fixed in 7.0.0-2018.18 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1013.13 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1011.11 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 7.0.0-1019.19 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 7.0.0-31.31.1 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-31.31.1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.95 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.36 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.0.13 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.95-1Fixed in 7.0.13-1 - Compensating control
In may_decode_fh(), take rcu_read_lock() around access to mount::mnt_ns, as in __prepend_path().
- Compensating control
Use WRITE_ONCE() for writers of mount::mnt_ns that can race with lockless readers.
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
The issue is reachable only when CONFIG_PREEMPTION or CONFIG_RCU_STRICT_GRACE_PERIOD is enabled. The affected path involves mounts created with open_tree(..., OPEN_TREE_CLONE) and concurrent handle-based opening and unmount activity.
What level of access does an attacker need?
The supplied severity vector indicates local access with low privileges and no user interaction is required. Exploitation depends on winning a race between may_decode_fh() reading mount::mnt_ns and teardown of the mount namespace.
What should administrators do if their kernel may be affected?
Update to a kernel containing the resolved fhandle fix referenced in the listed stable kernel commits. The fix protects the mount::mnt_ns access with RCU read-side locking and adds WRITE_ONCE() handling for racing writers.