diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-07 08:01:58 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-07 08:01:58 -0800 |
| commit | a80abfbb1013ffec7aa7e574b5ba9bcf02bd5462 (patch) | |
| tree | 900386508626cdf41760bcd915a5cce292754ee8 | |
| parent | 9dc520632a0dd3bdc37540528040771a96bdc8ff (diff) | |
| parent | c379b745e12a99f0a54bafaaf75fc710614511ce (diff) | |
| download | linux-a80abfbb1013ffec7aa7e574b5ba9bcf02bd5462.tar.gz linux-a80abfbb1013ffec7aa7e574b5ba9bcf02bd5462.tar.bz2 linux-a80abfbb1013ffec7aa7e574b5ba9bcf02bd5462.zip | |
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
| -rw-r--r-- | mm/slub.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c index d4367f25b20d..f1a5373eee7b 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4666,8 +4666,12 @@ new_objects: 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, |
