CVE-2026-74314 in Linuxinfo

Summary

by MITRE • 08/15/2026

In the Linux kernel, the following vulnerability has been resolved:

bpf: Cancel special fields on map value recycle

Map update and delete paths currently call bpf_obj_free_fields() when a value is being replaced or recycled. That makes field destruction depend on the context of the update/delete operation. For tracing programs this can include NMI context, where referenced kptr destructors, uptr unpinning, and graph root destruction are not generally safe.

Introduce bpf_obj_cancel_fields() for the reusable-value path. It only performs NMI-safe cleanup for timer, workqueue, and task_work fields. Fields that need full destruction are left attached to the recycled value and are destroyed by the final cleanup path instead.

Switch array and hashtab update/delete/recycle paths to this cancel helper. Keep bpf_obj_free_fields() for final map destruction and for bpf_mem_alloc destructors. Preallocated hashtabs do not have allocator destructors, so teardown continues to walk the normal and extra elements and fully destroy their fields.

This deliberately relaxes the eager-free semantics of map update/delete for special fields. Programs that relied on a recycled map slot becoming empty immediately after update/delete were relying on behavior that cannot be implemented safely from every BPF execution context without offloading arbitrary destructors.

There is a chance this change breaks programs making assumptions regarding the eager freeing of fields. If so, we can relax semantics to cancellation only when irqs_disabled() is true in the future. However, theoretically, map values that get reused eagerly already have weaker guarantees as parallel users can recreate freed fields before the new element becomes visible again.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 08/16/2026

The vulnerability addressed in this linux kernel patch relates to improper handling of special fields during bpf map value recycling operations. The issue stems from the inconsistent behavior of bpf_obj_free_fields() function which is invoked during map update and delete paths when values are being replaced or recycled. This function's execution context dependency creates significant safety concerns, particularly when invoked from non-preemptible contexts such as NMI (Non-Maskable Interrupt) handlers where certain kernel pointer destructors, user pointer unpinning operations, and graph root destruction procedures cannot be safely executed.

The technical flaw manifests in how bpf map value lifecycle management interacts with different execution contexts within the kernel. When tracing programs execute in NMI context, the standard field destruction mechanisms become unsafe due to the constraints imposed by interrupt handling requirements. This creates a potential for system instability or undefined behavior when bpf objects containing special fields are recycled through map operations that occur in these restricted contexts. The vulnerability represents a classic case of improper resource management where the timing and context of cleanup operations directly impact system stability.

The operational impact of this vulnerability extends beyond simple memory management concerns to affect the reliability of bpf tracing programs and kernel monitoring capabilities. Programs relying on immediate field freeing semantics during map updates may experience unexpected behavior or failures when operating in interrupt contexts. The change introduces a deliberate relaxation of eager-free semantics for special fields, which affects programs that assumed recycled map slots would become completely empty immediately after update or delete operations. This breaking change impacts the predictability of bpf program execution and requires careful consideration of existing implementations.

The solution implemented involves introducing a new bpf_obj_cancel_fields() helper function specifically designed for reusable-value paths during map operations. This new approach performs only NMI-safe cleanup operations targeting timer, workqueue, and task_work fields while leaving more complex field destruction to occur during final cleanup phases. The implementation follows established security principles by ensuring that potentially unsafe operations are deferred until safer execution contexts can be guaranteed. The patch maintains the existing bpf_obj_free_fields() function for final map destruction scenarios and bpf_mem_alloc destructors where full cleanup is required.

This vulnerability resolution aligns with industry best practices for kernel security design and addresses potential issues classified under CWE-691, which deals with insufficient control flow management in kernel contexts. The change also reflects considerations from ATT&CK framework concepts related to kernel-level persistence mechanisms and privilege escalation vectors. The implementation demonstrates proper resource lifecycle management by separating immediate cleanup operations from deferred destruction procedures based on execution context safety requirements. The patch ensures that bpf programs can operate reliably across different kernel execution contexts while maintaining system stability through controlled resource deallocation patterns.

The mitigation strategy focuses on maintaining backward compatibility where possible while ensuring system safety through context-aware field cleanup operations. Preallocated hashtabs continue to follow normal destruction paths since they lack allocator destructors, which maintains existing behavior for these specific cases. The approach taken represents a balanced solution that prioritizes system stability over strict eager-free semantics, recognizing that the theoretical guarantees of immediate field clearing in parallel execution environments are already weakened by concurrent access patterns. This change ultimately strengthens the kernel's resilience against potential race conditions and execution context violations during bpf map operations.

Responsible

Linux

Reservation

08/15/2026

Disclosure

08/15/2026

Moderation

accepted

CPE

ready

EPSS

0.00170

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!