CVE-2025-40348
Description
In the Linux kernel, the following vulnerability has been resolved:
slab: Avoid race on slab->obj_exts in alloc_slab_obj_exts
If two competing threads enter alloc_slab_obj_exts() and one of them fails to allocate the object extension vector, it might override the valid slab->obj_exts allocated by the other thread with OBJEXTS_ALLOC_FAIL. This will cause the thread that lost this race and expects a valid pointer to dereference a NULL pointer later on.
Update slab->obj_exts atomically using cmpxchg() to avoid slab->obj_exts overrides by racing threads.
Thanks for Vlastimil and Suren's help with debugging.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in Linux kernel's slab allocator can cause a NULL pointer dereference when concurrent threads race to allocate object extension vectors.
Vulnerability
Overview
In the Linux kernel, a race condition exists in the alloc_slab_obj_exts allocation within the slab allocator. When two threads concurrently call alloc_slab_obj_exts(), one thread may fail to allocate the object extension vector and incorrectly overwrite the valid pointer set by the other thread with the OBJEXTS_ALLOC_FAIL sentinel. This race can lead to a NULL pointer dereference when the thread that lost the race later attempts to use the corrupted pointer.
Exploitation
An attacker would need to trigger concurrent execution of alloc_slab_obj_exts() from multiple threads simultaneously, which is possible in multi-threaded or multi-process workloads. No special privileges are required beyond the ability to invoke memory allocation operations that trigger slab extension allocation. The race window is small but exploitable under the right timing conditions.
Impact
A successful exploit results in a NULL pointer dereference, causing a kernel crash (denial of service). In some configurations, this could potentially be leveraged for privilege escalation if the attacker can control the corrupted pointer, though the primary impact is system instability.
Mitigation
The fix uses cmpxchg() to atomically update slab->obj_exts, preventing the race condition. The patch has been merged into the Linux kernel stable tree [1]. Users should apply the latest kernel updates from their distribution to remediate this vulnerability.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
3c7af5300d7847c34feda6a9a6ed8bfd24ce1Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.