mirror of
https://github.com/torvalds/linux.git
synced 2025-12-01 15:35:58 +07:00
Merge tag 'slab-for-6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull slab fix from Vlastimil Babka: - Fix for potential infinite loop in kmalloc_nolock() when debugging is enabled for the cache (Vlastimil Babka) * tag 'slab-for-6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: slab: prevent infinite loop in kmalloc_nolock() with debugging
This commit is contained in:
@@ -4666,8 +4666,12 @@ new_objects:
|
|||||||
if (kmem_cache_debug(s)) {
|
if (kmem_cache_debug(s)) {
|
||||||
freelist = alloc_single_from_new_slab(s, slab, orig_size, gfpflags);
|
freelist = alloc_single_from_new_slab(s, slab, orig_size, gfpflags);
|
||||||
|
|
||||||
if (unlikely(!freelist))
|
if (unlikely(!freelist)) {
|
||||||
|
/* This could cause an endless loop. Fail instead. */
|
||||||
|
if (!allow_spin)
|
||||||
|
return NULL;
|
||||||
goto new_objects;
|
goto new_objects;
|
||||||
|
}
|
||||||
|
|
||||||
if (s->flags & SLAB_STORE_USER)
|
if (s->flags & SLAB_STORE_USER)
|
||||||
set_track(s, freelist, TRACK_ALLOC, addr,
|
set_track(s, freelist, TRACK_ALLOC, addr,
|
||||||
|
|||||||
Reference in New Issue
Block a user