Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98036 Overview
CVE-2026-98036 is a use-after-free vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) subsystem. The flaw resides in rhtab_map_update_elem(), which incorrectly reinitializes special fields on map elements returned from bpf_mem_cache_alloc(). When the allocator recycles a unit from its RCU-pending list, reinitialization clears the only pointer to a pending timer, preventing the destructor from canceling it. A BPF program can then trigger a timer callback that operates on freed memory.
Critical Impact
A local attacker with the ability to load BPF programs can trigger kernel memory corruption through dangling timer callbacks, leading to potential privilege escalation or denial of service.
Affected Products
- Linux kernel versions containing the vulnerable BPF rhtab_map_update_elem() implementation
- Distributions shipping affected mainline kernels prior to the fix commits
- Systems where unprivileged users can load BPF programs via bpf() syscall
Discovery Timeline
- 2026-09-25 - CVE-2026-98036 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-98036
Vulnerability Analysis
The vulnerability occurs during BPF map element insertion in the resizable hash table (rhtab) code path. rhtab_map_update_elem() obtains an element from bpf_mem_cache_alloc() and then initializes special fields such as timers, workqueues, and kptrs. The allocator can return either a freshly zeroed unit or a recycled unit from its RCU-pending list, where the registered destructor has not yet executed.
When a BPF program retains a map-value pointer after deleting its element, it can still initialize and arm a timer through that pointer. If the deleted unit is recycled through a subsequent update, check_and_init_map_value() overwrites the only remaining pointer to the armed timer. Neither a later deletion nor rhtab_mem_dtor() can cancel the orphaned timer. The callback eventually runs with its key and value pointing into memory that has been reallocated.
Root Cause
The root cause is improper lifecycle management of special fields on recycled allocator units. Special fields represent ownership state that must remain visible to the eventual destructor. The fix removes the reinitialization step on insertion. Fresh allocator units are already zeroed, and recycled units retain the ownership state required for cleanup. This aligns the preallocated path with the non-preallocated hash-map behavior established by commit 275c30bcee66 ("bpf: Don't reinit map value in prealloc_lru_pop").
Attack Vector
Exploitation requires local access and the capability to load BPF programs. The attacker crafts a program that creates a timer in a map value, deletes the map entry, and forces a recycle through subsequent updates. When the timer callback fires against freed memory, it enables arbitrary kernel memory corruption primitives. See the upstream kernel commit for the fix details.
Detection Methods for CVE-2026-98036
Indicators of Compromise
- Kernel oops or panic messages referencing BPF timer callbacks or bpf_timer_cb
- KASAN reports flagging use-after-free in BPF map value memory regions
- Unexpected crashes in rhtab code paths following heavy BPF map update activity
Detection Strategies
- Audit bpf() syscall usage for unprivileged processes that create maps containing timer fields
- Monitor for processes that rapidly create, delete, and update BPF map entries with embedded timers
- Enable KASAN in test environments to surface use-after-free conditions during BPF workload execution
Monitoring Recommendations
- Collect kernel ring buffer logs and forward kernel crash telemetry to a centralized logging system
- Track loaded BPF programs and attached timers using bpftool prog and bpftool map inventories
- Alert on kernel warnings or BUG messages originating from kernel/bpf/ subsystem paths
How to Mitigate CVE-2026-98036
Immediate Actions Required
- Apply the upstream kernel patch or vendor-provided update that removes special field reinitialization in rhtab_map_update_elem()
- Restrict BPF program loading to privileged users by setting kernel.unprivileged_bpf_disabled=1
- Inventory systems running affected kernel versions and prioritize patching for multi-tenant hosts
Patch Information
The fix is available in the upstream Linux kernel through two commits: commit 5df46ddc and commit 6a5266b8. The patch removes the call to reinitialize special fields on insertion, preserving the destructor-visible ownership state on recycled allocator units.
Workarounds
- Disable unprivileged BPF via the kernel.unprivileged_bpf_disabled sysctl where application compatibility allows
- Remove CAP_BPF and CAP_SYS_ADMIN from workloads that do not require BPF program loading
- Apply seccomp filters to block the bpf() syscall for untrusted processes and containers
# Disable unprivileged BPF program loading
sysctl -w kernel.unprivileged_bpf_disabled=1
# Persist across reboots
echo 'kernel.unprivileged_bpf_disabled=1' > /etc/sysctl.d/90-bpf-hardening.conf
# Verify current setting
sysctl kernel.unprivileged_bpf_disabled
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

