CVE-2026-98036

bpf: Preserve special fields in recycled rhtab elements

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

bpf: Preserve special fields in recycled rhtab elements

rhtab_map_update_elem() initializes special fields after obtaining an
element from bpf_mem_cache_alloc(). The allocator can return a fresh,
zeroed unit, or recycle one from its RCU-pending lists before the
registered destructor has run.

A BPF program can retain a map-value pointer after deleting its element
and initialize and arm a timer through that pointer. If the deleted unit
is recycled, check_and_init_map_value() clears the only pointer to the
timer. Neither a later deletion nor rhtab_mem_dtor() can then cancel it,
and the callback can run with its key and value pointing into freed memory.

Do not reinitialize special fields on insertion. Fresh allocator units are
already zeroed. For recycled units, the special fields are ownership state
that must remain visible to the eventual destructor. copy_map_value()
already skips those fields, matching the non-preallocated hash-map path and
the lifecycle established by commit 275c30bcee66 ("bpf: Don't reinit map
value in prealloc_lru_pop").

[ kkd: Split out the fix and rewrote the commit log ]

Analysis

AI-generated

Technical impact

The flaw is a use‑after‑free in the Linux kernel’s BPF subsystem. When a BPF program deletes a map element it can retain a pointer to the freed value and use that pointer to arm a timer. If the freed unit is recycled before the registered destructor runs, a nulling operation clears the timer pointer, and the callback later executes with its key and value pointing into deallocated memory, potentially causing memory corruption or a crash. The vulnerability is tied to improper memory management (CWE‑825).

Affected Systems

All Linux kernel releases that contain the BPF rhtab_map_update_elem implementation before the commit that fixed this issue are affected. The impact spans the Linux kernel product broadly. No specific affected versions are listed in the available data, so any release prior to the fix may be at risk.

Risk and Exploitability

The vulnerability can be exploited by an attacker who can load custom BPF code with kernel privileges, typically only a privileged user or a compromised system. The CVSS score of 5.5 indicates moderate severity. The EPSS score is <1% and the issue is not listed in CISA’s KEV catalog, suggesting a low probability of exploitation, but the potential impact of a kernel use‑after‑free remains significant.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a kernel version that contains the fix introduced by commit 275c30bcee66 or apply the corresponding patch to your current kernel
  • Configure the system to restrict BPF program loading strictly to trusted users, for example via AppArmor, SELinux, or user‑group restrictions
  • If an update is not possible, consider disabling BPF entirely by setting /proc/sys/kernel/bpf_disabled to 1 or an equivalent kernel parameter

Generated by OpenCVE AI on September 30, 2026 at 14:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

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

None

cvssV3_1

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

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Preserve special fields in recycled rhtab elements rhtab_map_update_elem() initializes special fields after obtaining an element from bpf_mem_cache_alloc(). The allocator can return a fresh, zeroed unit, or recycle one from its RCU-pending lists before the registered destructor has run. A BPF program can retain a map-value pointer after deleting its element and initialize and arm a timer through that pointer. If the deleted unit is recycled, check_and_init_map_value() clears the only pointer to the timer. Neither a later deletion nor rhtab_mem_dtor() can then cancel it, and the callback can run with its key and value pointing into freed memory. Do not reinitialize special fields on insertion. Fresh allocator units are already zeroed. For recycled units, the special fields are ownership state that must remain visible to the eventual destructor. copy_map_value() already skips those fields, matching the non-preallocated hash-map path and the lifecycle established by commit 275c30bcee66 ("bpf: Don't reinit map value in prealloc_lru_pop"). [ kkd: Split out the fix and rewrote the commit log ]
Title bpf: Preserve special fields in recycled rhtab elements
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-825

    Expired Pointer Dereference

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 9:12 AM
Reserved
Sep 25, 2026, 10:19 AM
Status
Received
Published
Sep 25, 2026, 11:17 AM
Modified
Oct 19, 2026, 10:17 AM
Severity
Moderate
Public date
Sep 25, 2026, 12:00 AM