CVE-2026-89677: nfsd: fix possible fh_compose of wrong dentry in nfsd4_create_file()
In the Linux kernel, the following vulnerability has been resolved:
nfsd: fix possible fhcompose of wrong dentry in nfsd4createfile()
dentrycreate() can hypothetically provide a different dentry than the one passed in. This could happen, for example, if the exported filesystem is NFS, and the server returned to OPEN a filehandle which matched a directory that was already in the dcache. Clearly this would not be expected!
If this were to happen the dentry (child) that was already stored in resfhp could be freed and later dereferenced.
We shouldn't call fhcompose() until we are certain that we have the final dentry, so this patch moved the fhcompose() call to two places: one for the case where the target already exists, and one after dentrycreate() where it was created.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch nfsd: fix possible fh_compose of wrong dentry in nfsd4_create_file()
Event History
Frequently Asked Questions
What conditions are needed to trigger the issue?
The problematic path is in NFS server file creation handling. The described scenario requires dentry_create() to return a different dentry than the one supplied, which can occur hypothetically when the exported filesystem is itself NFS and an OPEN response returns a filehandle matching a directory already present in the dcache.
What is the likely impact if the condition occurs?
A child dentry previously stored in the response filehandle can be freed and later dereferenced. This indicates a potential use-after-free condition in the NFS server's create-file path.
How is the issue addressed by the fix?
The fix delays fh_compose() until the final dentry is known. It invokes fh_compose() separately when the target already exists and after dentry_create() when the target was created.