ZeroHour

CVE-2026-89668

mass

Use-after-free via stale debugfs fops in Linux kernel nfsd init path

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

The Linux kernel's nfsd (NFS server) subsystem initializes its debugfs interface before its NFSv4 slab caches in init_nfsd(); if the slab allocation fails, the error path returns without calling nfsd_debugfs_exit(), leaving orphaned debugfs files whose file_operations pointers reference the unloaded module's text. A local attacker with low privileges on a system where the nfsd module load has failed could access these orphaned files under /sys/kernel/debug, invoking stale function pointers in a use-after-free that CVSS rates at 7.8 (local vector, high confidentiality/integrity/availability impact). In practice, triggering the flaw requires debugfs to be mounted and an nfsd initialization failure, so exposure is largely theoretical. The fix reorders initialization so debugfs is created only after the slabs succeed, and adjusts unwind paths to reverse (LIFO) order, a cleanup with no functional change. No public proof of concept exists and no exploitation has been observed.

What to do: Apply distribution kernel updates once the fix is backported, as this is resolved by a simple init-order reordering. On production hosts, verify whether debugfs (/sys/kernel/debug) is mounted and unmount or restrict it if not needed. Watch for failed nfsd module loads followed by accesses to the orphaned nfsd debugfs entries, though no exploitation has been observed.

Affected
Linux kernel (nfsd, CONFIG_NFSD with debugfs support)
Estimated exposure
massbillions of Linux installations ship the nfsd code, but only a small subset with debugfs mounted and a failed nfsd module load are practically reachable — nfsd is a standard kernel module shipped by virtually every mainstream Linux distribution, but the vulnerable state additionally requires debugfs to be mounted and an nfsd initialization allocation failure, which sharply limits…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

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.

Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.