CVE-2026-99415: ovl: set the revalidate flags after d_instantiate()
In the Linux kernel, the following vulnerability has been resolved:
ovl: set the revalidate flags after dinstantiate()
stat() of a file on an overlayfs mount triggers a kernel warning and fails with ECHILD if another task is creating that file at the same time. This happens on an overlay with a FUSE upper layer, which is the layer where overlayfs creates new files. Write access to a directory on such an overlay is all a user needs to run the two tasks.
The revalidate flags are DCACHEOPREVALIDATE and DCACHEOPWEAKREVALIDATE. They tell path walk to call ->drevalidate() or ->dweakrevalidate() on a dentry, so that the filesystem can check that the cached dentry is still valid. An overlay dentry only has one of these flags if a dentry in one of its layers has it. FUSE dentries have the first one.
When a flag is set on an overlay dentry, path walk calls ovldentryrevalidatecommon(). That function only expects a dentry without an inode in RCU walk, while the dentry is being destroyed. For such a dentry outside of RCU walk, it hits a WARNON() and returns -ECHILD. So a negative overlay dentry must never have the flags set.
ovlinstantiate() breaks this rule. When a task creates a file, the overlay dentry for the new name is hashed but still negative. ovlinstantiate() then works in this order:
- It copies the flags from the new upper dentry to the overlay dentry. - It calls ovlgetinode(), which can sleep in a getxattr request to the FUSE server. - Only then does it call dinstantiate().
A second task that looks up the name between the first step and the last finds a negative dentry with the flags set and revalidates it.
Reproduced with a FUSE server that delays its getxattr reply: stat() of a name that was being created hit the WARNON() and failed with ECHILD.
Fix this by setting the flags after dinstantiate().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Compensating control
In overlayfs, set the revalidate flags only after calling d_instantiate() in ovl_instantiate().