CVE-2026-139604

bpf: Clear the insn array used flag with release semantics

Published Nov 30, 2026 CVSS 3.1 · 6.4 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Clear the insn array used flag with release semantics

A program that fails after the JIT ran, for example in bpf_check_tail_call(),
has already stored its jitted offsets and target pointers into the insn array
maps it uses through bpf_prog_update_insn_ptrs() when release_insn_arrays()
hands them back by clearing the used flag with a plain atomic_set(). Nothing
orders those stores before the flag, so on a weakly ordered architecture they
can still be in flight when the next program takes the map: it is acquired
with atomic_xchg() in bpf_insn_array_init() and reset there, and the late
stores then land on top of whatever the new owner has written since, be it
that reset or the pointers its own JIT stored, leaving entries that point
into an image which is about to be freed.

Clear the flag with atomic_set_release() instead, so that everything the
releasing program stored is visible before the map can be acquired again.
This pairs with the fully ordered atomic_xchg() on the acquire side.

Analysis

AI-generated

Technical impact

The vulnerability exists in the Linux kernel’s BPF subsystem, where the flag that indicates an instruction‑array map has been used is cleared with an unsynchronised atomic_set. The JIT compiler stores compiled offsets and target pointers in the same array, but those stores are not ordered before the flag clears. On weakly ordered architectures this enables a race where the next program that acquires the map can see stale pointers that reference memory that has already been freed or overwritten, resulting in a use‑after‑free and memory corruption. This flaw can let an attacker execute arbitrary code in kernel mode, crash the system, or otherwise disrupt availability.

Affected Systems

All Linux kernel releases that have not been patched to change the flag clearance to atomic_set_release are affected. Because the fix is applied at the kernel source level, any distribution or custom kernel that builds from an unpatched Linux source before the referenced commit risks exposure. The impact should be considered broad: any system running a legacy kernel susceptible to the race could be vulnerable.

Risk and Exploitability

No CVSS score or EPSS rating is publicly available, and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires a race condition between the JIT compiler and another BPF program that reclaims the same instruction array. This typically demands privileged access or the ability to load malicious BPF programs, making the attack vector likely local or privileged. While no confirmed exploits exist yet, the potential for kernel‑level compromise warrants urgent attention.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a revision that replaces atomic_set with atomic_set_release for the instruction array flag
  • If a kernel update cannot be applied immediately, disable BPF JIT by setting /proc/sys/net/core/bpf_jit_enable to 0 to eliminate the race condition
  • Restrict the ability to load or execute BPF programs to trusted users and firewall traffic that would load such programs

Generated by OpenCVE AI on December 1, 2026 at 17:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-821
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.4, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-362
CWE-416
Type Values Removed Values Added
Weaknesses CWE-362
CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Clear the insn array used flag with release semantics A program that fails after the JIT ran, for example in bpf_check_tail_call(), has already stored its jitted offsets and target pointers into the insn array maps it uses through bpf_prog_update_insn_ptrs() when release_insn_arrays() hands them back by clearing the used flag with a plain atomic_set(). Nothing orders those stores before the flag, so on a weakly ordered architecture they can still be in flight when the next program takes the map: it is acquired with atomic_xchg() in bpf_insn_array_init() and reset there, and the late stores then land on top of whatever the new owner has written since, be it that reset or the pointers its own JIT stored, leaving entries that point into an image which is about to be freed. Clear the flag with atomic_set_release() instead, so that everything the releasing program stored is visible before the map can be acquired again. This pairs with the fully ordered atomic_xchg() on the acquire side.
Title bpf: Clear the insn array used flag with release semantics
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-821

    Incorrect Synchronization

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM
Severity
Moderate
Public date
Nov 30, 2026, 1:36 PM