HIGH Introduced in 7.0
selinux BpfToken TOCTOU
CVE-2026-99129
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: selinux: fix BPF token permission checks Avoid multiple lookups of the bpffs creator SID using the token's file descriptor when the same information can be found via the resolved path/dentry (in selinux_bpf_token_create()) or the token itself (in selinux_bpf_map_create() and selinux_bpf_prog_load()). Not only does this simplify the code, it avoids potential TOCTOU issues if the user changes the token file descriptor passed into the kernel.
02KernelScan AI Analysis
Risk summary
An unprivileged local user with a delegated BPF token can exploit a TOCTOU race condition to bypass SELinux policy checks, potentially gaining unauthorized BPF map creation and program loading privileges. This allows privilege escalation to kernel level in environments using SELinux with BPF token delegation.
Vulnerability analysis
A time-of-check-time-of-use (TOCTOU) race condition exists in SELinux's BPF token permission checks. When an unprivileged process uses a delegated BPF token to create maps or load programs, the kernel repeatedly looks up the token's file descriptor to determine the creator's security context. A malicious process can race this lookup by replacing the file descriptor between the check and use, potentially bypassing SELinux policy enforcement. The fix stores the grantor SID directly in the token object at creation time—using the already-resolved VFS path—and references this stored value for subsequent permission checks, eliminating the repeated file descriptor lookups. This vulnerability is reachable by any unprivileged local user who has received a BPF token from a privileged delegator, such as in containerized workloads where BPF functionality is delegated to tenant workloads.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 7.0 | 7.2.13 | e1ef306ba20e |
| mainline | 7.0 | 7.3 | 77d499e61d36 |