CVE-2026-139324

bpf: Don't leak the inode when token creation fails

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Don't leak the inode when token creation fails

bpf_token_create() allocates a bpffs inode and hands it to
alloc_file_pseudo(). The inode reference only moves to the new file when
that call succeeds: alloc_file_pseudo() leaves the caller's reference alone
on failure, and FD_PREPARE() does not even evaluate the file expression
when it cannot get a descriptor.

Before the conversion to FD_PREPARE() the error path did iput(inode). The
conversion dropped it, so each BPF_TOKEN_CREATE 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 RLIMIT_NOFILE, and the
leaked inodes make umount of that bpffs instance complain about busy
inodes.

Put the inode again if no file was created.

Analysis

AI-generated

Technical impact

The Linux kernel's bpf_token_create routine allocates an inode for a bpffs entry but fails to release it when the subsequent file creation fails due to resource limits such as exceeding the per-process file descriptor count or running out of memory. Each failed attempt leaks an inode reference, and repeated failures can accumulate. Because these leaked inodes remain busy, attempting to unmount the bpffs instance later results in errors, potentially rendering the filesystem unusable and impacting services that rely on BPF. The bug does not grant code execution but can degrade system availability.

Affected Systems

All unpatched Linux kernel releases that include the vulnerable bpf_token_create implementation are affected. No explicit version numbers are provided, so any kernel containing this code before the official patch is presumed vulnerable.

Risk and Exploitability

The vulnerability is not listed in the CISA KEV catalog and has no EPSS score available, suggesting that no widespread exploitation has been observed. It can be triggered locally by any process that invokes BPF token creation, for example by lowering RLIMIT_NOFILE or causing memory pressure. Exploitation is limited to the local system and does not involve remote code execution, but repeated failures can lead to resource exhaustion that disrupts BPF filesystem operations and overall system stability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the Linux kernel update that fixes the bpf_token_create inode leak.
  • If an immediate kernel upgrade is not possible, increase or restore the per-process RLIMIT_NOFILE to reduce the chance of triggering the failure path.
  • Avoid repeatedly creating BPF tokens in processes that may hit resource limits, and monitor inode usage to detect potential leaks before they cause unmount failures.

Generated by OpenCVE AI on December 1, 2026 at 11:07 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-399
Type Values Removed Values Added
Weaknesses CWE-399
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Don't leak the inode when token creation fails bpf_token_create() allocates a bpffs inode and hands it to alloc_file_pseudo(). The inode reference only moves to the new file when that call succeeds: alloc_file_pseudo() leaves the caller's reference alone on failure, and FD_PREPARE() does not even evaluate the file expression when it cannot get a descriptor. Before the conversion to FD_PREPARE() the error path did iput(inode). The conversion dropped it, so each BPF_TOKEN_CREATE 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 RLIMIT_NOFILE, and the leaked inodes make umount of that bpffs instance complain about busy inodes. Put the inode again if no file was created.
Title bpf: Don't leak the inode when token creation fails
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

No weakness.

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM