CVE-2026-139324: bpf: Don't leak the inode when token creation fails
In the Linux kernel, the following vulnerability has been resolved:
bpf: Don't leak the inode when token creation fails
bpftokencreate() allocates a bpffs inode and hands it to allocfilepseudo(). The inode reference only moves to the new file when that call succeeds: allocfilepseudo() leaves the caller's reference alone on failure, and FDPREPARE() does not even evaluate the file expression when it cannot get a descriptor.
Before the conversion to FDPREPARE() the error path did iput(inode). The conversion dropped it, so each BPFTOKENCREATE that fails with -EMFILE, -ENFILE or -ENOMEM at this point leaks an inode. A task that is allowed to create tokens can hit this at will by lowering RLIMITNOFILE, and the leaked inodes make umount of that bpffs instance complain about busy inodes.
Put the inode again if no file was created.
Affected Software
Event History
Frequently Asked Questions
Who can trigger the inode leak?
A task that is permitted to create BPF tokens can trigger it. The task can do so repeatedly by lowering its RLIMIT_NOFILE limit.
What failure conditions cause the leak?
The leak occurs when BPF_TOKEN_CREATE reaches token creation but alloc_file_pseudo() fails with -EMFILE, -ENFILE, or -ENOMEM. In these cases, no file is created and the allocated bpffs inode reference is not released.
What is the observable impact of repeated exploitation?
Each qualifying failed BPF_TOKEN_CREATE leaks a bpffs inode. Accumulated leaked inodes cause unmounting the affected bpffs instance to report busy inodes.
How is the issue fixed?
The fix releases the inode when no file was created, restoring cleanup on the failure path.