CVE-2026-139547

bpf: arena: Allocate the fault-in page outside the lock

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: arena: Allocate the fault-in page outside the lock

arena_vm_fault() allocated the page while holding arena->spinlock, so it
could only use the non-blocking allocator, which never reclaims. Once the
memcg is at memory.max that allocation just fails, the fault turns into
VM_FAULT_SIGSEGV, and the process gets a SIGSEGV on a perfectly valid
arena address. Hitting memory.max is routine (e.g. page cache from
reading a big file), so this kills innocent processes over memory that
reclaim could have freed.

Rework the fault handler:

- Preallocate the page before taking the lock, like do_anonymous_page()
does, so it can sleep and reclaim, instead of turning a routine
memory.max into a fake segfault. The allocation uses
__GFP_RETRY_MAYFAIL so it never invokes the OOM killer: the page is
charged to the map's memcg, which need not be the faulting task's, so
an OOM there could kill unrelated tasks in the map's cgroup while a
foreign faulter could never be its victim. map->numa_node is always
NUMA_NO_NODE for an arena (BPF_F_NUMA_NODE is rejected), so the page
comes from the local node, as before.

- On allocation failure fall through to the locked recheck rather than
failing right away: a page a concurrent allocator installed meanwhile
is used, otherwise the non-blocking fallback fails and we return
VM_FAULT_SIGBUS. Not VM_FAULT_OOM: nothing ran the OOM killer, and the
fault path would just retry it forever.

- A lockless probe skips that preallocation when a page is already mapped
(e.g. allocated by the bpf program), so the common case wastes no
allocation. The rare race where such a page is freed before we take the
lock falls back to the non-blocking allocator under the lock.

- Return VM_FAULT_SIGBUS for the other non-recoverable errors
(allocation, range-tree and page-table failures) instead of
VM_FAULT_SIGSEGV; the lock failure already did. Only
BPF_F_SEGV_ON_FAULT, and a scratch-page hole under that flag, is a
real user addressing error and keeps VM_FAULT_SIGSEGV.

- Tidy up the error labels.

Analysis

AI-generated

Technical impact

The vulnerability resides in the Linux kernel’s BPF arena memory allocator. The allocator held the arena spinlock while attempting to fault in a page using a non‑blocking allocator that never reclaims memory. When the memory control group reached its maximum, the allocation failed and the kernel converted the fault into a SIGSEGV, crashing any process accessing a valid BPF arena address. The result is a local denial of service: innocent processes are terminated and the system suffers from arbitrary page faults caused by normal memory pressure.

Affected Systems

All installations of the Linux kernel that compile the BPF arena code, including mainstream distributions. The affected code does not depend on a specific kernel release in the provided data, so all supported kernels that enable BPF arenas are potentially vulnerable.

Risk and Exploitability

The issue is only exploitable when a process triggers a page fault in a BPF arena that runs on a system where the memory control group has reached its limit. The attacker would need local access to compile or load a BPF program that creates such a fault. EPSS data is not available and the vulnerability is not listed in the CISA KEV catalog, but the lack of an OOM killer invocation and the silent crash of processes make the risk high. The CVSS score is not supplied, but the impact and availability of the exploit path suggest moderate to high severity.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the Linux kernel patch that preallocates fault pages outside the arena spinlock (the fix referenced by the Git commit 321b0dc5e8ad).
  • If an immediate kernel update is not possible, disable or limit usage of BPF programs on the affected hosts or drop the BPF capability from untrusted users.
  • Adjust cgroup memory limits for processes that use BPF arenas to avoid hitting the memory.max threshold that triggers the fault path.

Generated by OpenCVE AI on November 30, 2026 at 23:50 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
Description In the Linux kernel, the following vulnerability has been resolved: bpf: arena: Allocate the fault-in page outside the lock arena_vm_fault() allocated the page while holding arena->spinlock, so it could only use the non-blocking allocator, which never reclaims. Once the memcg is at memory.max that allocation just fails, the fault turns into VM_FAULT_SIGSEGV, and the process gets a SIGSEGV on a perfectly valid arena address. Hitting memory.max is routine (e.g. page cache from reading a big file), so this kills innocent processes over memory that reclaim could have freed. Rework the fault handler: - Preallocate the page before taking the lock, like do_anonymous_page() does, so it can sleep and reclaim, instead of turning a routine memory.max into a fake segfault. The allocation uses __GFP_RETRY_MAYFAIL so it never invokes the OOM killer: the page is charged to the map's memcg, which need not be the faulting task's, so an OOM there could kill unrelated tasks in the map's cgroup while a foreign faulter could never be its victim. map->numa_node is always NUMA_NO_NODE for an arena (BPF_F_NUMA_NODE is rejected), so the page comes from the local node, as before. - On allocation failure fall through to the locked recheck rather than failing right away: a page a concurrent allocator installed meanwhile is used, otherwise the non-blocking fallback fails and we return VM_FAULT_SIGBUS. Not VM_FAULT_OOM: nothing ran the OOM killer, and the fault path would just retry it forever. - A lockless probe skips that preallocation when a page is already mapped (e.g. allocated by the bpf program), so the common case wastes no allocation. The rare race where such a page is freed before we take the lock falls back to the non-blocking allocator under the lock. - Return VM_FAULT_SIGBUS for the other non-recoverable errors (allocation, range-tree and page-table failures) instead of VM_FAULT_SIGSEGV; the lock failure already did. Only BPF_F_SEGV_ON_FAULT, and a scratch-page hole under that flag, is a real user addressing error and keeps VM_FAULT_SIGSEGV. - Tidy up the error labels.
Title bpf: arena: Allocate the fault-in page outside the lock
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

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