HIGH Introduced in 6.16
nfsd DebugfsInit UAF
CVE-2026-89668
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.0MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: nfsd: move nfsd_debugfs_init() after nfsd4_init_slabs() in init_nfsd() nfsd_debugfs_init() runs before nfsd4_init_slabs() in init_nfsd(). If the slab allocation fails, the bare "return retval" bypasses nfsd_debugfs_exit(), leaving orphan debugfs files with stale fops pointers into the freed module text. Move nfsd_debugfs_init() to after the slab init succeeds, so the early return has no debugfs state to clean up. Since debugfs is now the more recently initialized of the two, also update the unwind paths to match reverse-initialization (LIFO) order: run nfsd_debugfs_exit() before nfsd4_free_slabs() in both the init_nfsd() error path and exit_nfsd(). The nfsd debugfs files only reference module-global state and have no dependency on the slab caches, so that reordering is a cleanup with no functional change.
02KernelScan AI Analysis
Risk summary
A local privileged attacker who can trigger the nfsd module to load under memory pressure can leave orphaned debugfs files whose operations pointers reference freed module text. Accessing those files causes a use-after-free that can crash the kernel or potentially corrupt memory. Exploitation requires root-level module loading and debugfs access, plus a slab allocation failure during init.
Vulnerability analysis
During initialization of the NFS server module, debug files are created before internal memory pools are set up. If that memory setup then fails, the module load aborts and its code is freed, but the debug files remain with pointers that now reference the freed module text. Any later access to those orphaned files calls through stale pointers into reclaimed memory, producing a use-after-free that typically crashes the kernel. The fix creates the debug files only after memory setup succeeds, so a failure during startup has no debug state to leave behind, and reorders cleanup to remove debug files before freeing memory. The bug is reachable only locally by an attacker who can load the NFS server module and later access the debug filesystem, both of which require root privileges, and it additionally depends on a memory allocation failure during module startup.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.16 | 6.18.50 | 4ae5d7490ae6 |
| 7.2 | 6.16 | 7.2.4 | ab43ff94f5df |
| mainline | 6.16 | 7.3 | 2c390c8a1764 |