slab: Avoid race on slab->obj_exts in alloc_slab_obj_exts
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
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.
From the CVE record · Linux
A race in the Linux kernel’s alloc_slab_obj_exts() can overwrite a valid object-extension pointer when competing threads enter the function and one allocation fails. This can lead to a NULL pointer dereference. The input does not specify an attacker path, authentication requirements, or user interaction.
Anyone running the Linux kernel should check whether their version is affected; affected versions are not specified.