You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
slab: Avoid race on slab->obj_exts in alloc_slab_obj_exts
commit 6ed8bfd upstream.
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.
Fixes: f7381b9 ("slab: mark slab->obj_exts allocation failures unconditionally")
Cc: <[email protected]>
Suggested-by: Suren Baghdasaryan <[email protected]>
Signed-off-by: Hao Ge <[email protected]>
Reviewed-by: Harry Yoo <[email protected]>
Reviewed-by: Suren Baghdasaryan <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vlastimil Babka <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
0 commit comments