HIGH Introduced in 2.6.16
configfs SymlinkTarget UAF
CVE-2026-97950
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: configfs: pin the symlink target's dirent instead of chasing ->ci_dentry create_link() reads the target's configfs_dirent from item->ci_dentry->d_fsdata, relying on the item reference taken by get_target(). That reference pins the item, not its dentry: the dentry is pinned by DCACHE_PERSISTENT, which configfs_remove_dir() releases via simple_rmdir() while the item is still alive. A symlink racing with rmdir of its target can therefore find ->ci_dentry freed and its dirent released, triggering WARN_ON(!atomic_read(&sd->s_count)) in configfs_get(). Take the dirent in get_target() as well, under ->d_lock and atomically with the item reference, and pass it down to create_link(). A hashed dentry has not been killed yet, so its ->d_fsdata reference keeps the dirent alive there.
02KernelScan AI Analysis
Risk summary
A local attacker who can issue symlink and rmdir operations on a mounted configfs filesystem can exploit a race condition to trigger a use-after-free on internal kernel data structures. This can lead to kernel memory corruption, potentially enabling arbitrary read/write access or denial of service via kernel panic. Systems that use configfs (e.g., USB gadget configuration, OCFS2 cluster stacks) and expose local access are at risk.
Vulnerability analysis
A race between creating a symlink and removing its target directory in configfs can trigger a use-after-free. The symlink operation held a reference to the target object but not to its underlying directory record, so a concurrent removal could free that record while the symlink code was still reading from it. The corrected code now holds a reference to the directory record for the entire symlink operation, preventing premature freeing. This can be triggered locally by any account that can create symlinks and remove directories in a mounted configfs filesystem.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 2.6.16 | 6.12.112 | 846ff40fd57a |
| 6.18 | 2.6.16 | 6.18.53 | 4f54beb2e7f6 |
| 7.2 | 2.6.16 | 7.2.7 | d47c5de1cd6b |
| mainline | 2.6.16 | 7.3-rc3 | a7c1290eef60 |