mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 08:45:26 -05: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 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
|
||||
if (kmem_cache_debug(s)) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (s->flags & SLAB_STORE_USER)
|
||||
set_track(s, freelist, TRACK_ALLOC, addr,
|
||||
|
||||
Reference in New Issue
Block a user