KernelScan.io

HIGH Introduced in 6.15

bpf PathUnlink Race

CVE-2026-98543

CVSS 7.3 / 10.0 NVD

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

KernelScan AI6.4MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: bpf: fs/xattr: don't assume the inode is locked in path_unlink/path_rmdir bpf_lsm_has_d_inode_locked() makes the verifier rewrite bpf_[set|remove]_dentry_xattr() to the _locked variants, which assume that the caller already holds the inode's i_rwsem. The path_unlink and path_rmdir hooks are listed, but security_path_unlink() and security_path_rmdir() run before vfs_unlink()/vfs_rmdir() take the victim inode's i_rwsem, so a sleepable BPF LSM program attached to either hook mutates the victim's xattrs without the lock held. Drop the two path hooks from d_inode_locked_hooks so that the verifier keeps the locking bpf_[set|remove]_dentry_xattr() variants, which take the lock themselves.

02

Engine v0.9.0

Risk summary

A privileged local attacker who can load BPF LSM programs can exploit a race condition in the path_unlink and path_rmdir security hooks to mutate filesystem extended attributes without proper locking, potentially leading to data corruption, information disclosure, or denial of service. The vulnerability requires root privileges (CAP_SYS_ADMIN and CAP_BPF) and a kernel configured with CONFIG_SECURITY_PATH and BPF LSM support.

Affectedfs/bpf_fs_kfuncs.c (bpf lsm)

Vulnerability analysis

The BPF verifier incorrectly assumed that the path_unlink and path_rmdir LSM hooks run with the victim inode's i_rwsem already held, causing it to rewrite xattr manipulation kfuncs to their '_locked' variants which skip locking. In reality, these hooks execute before vfs_unlink/vfs_rmdir acquire the lock, so a sleepable BPF LSM program attached to either hook can race with the filesystem's own xattr operations. The fix removes these two hooks from the d_inode_locked_hooks set, forcing the verifier to use the regular kfunc variants that acquire the lock themselves. Only a privileged user with CAP_SYS_ADMIN and CAP_BPF in the initial namespace can load such a BPF LSM program, making this a local privilege escalation and data integrity issue.

03

BranchIntroducedFixed inPatch commit
6.186.156.18.557504b677c437
7.26.157.2.9640d37fbd34d
mainline6.157.335d442ed1f86