[PATCH 6.12.y 0/2] mm/slab: fix unbounded recursion in free path with memalloc profiling

"Harry Yoo (Oracle)" <[email protected]>
Newsgroups org.kernel.vger.stable,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <20260806-kmalloc-no-objext-for-6-12-y-v1-0-036dfc3273fc@kernel.org>
This is backport of "mm/slab: fix unbounded recursion in free path with
memalloc profiling" series [1] for 6.12.y.

The patch 1 was adjusted for 6.12 as mem_profiling_support is marked
__init in 6.12. I simply resolved this by marking
mem_alloc_profiling_permanently_disabled() __init since in 6.12 we need
it only when creating kmalloc-no-objext-* caches during the boot
process.

Patch 2 has slight functional differences compared to mainline
due to lack of SLAB_ALLOC_* flags, sheaves, and kmalloc_nolock().
I described those subtlties in the backporting notes in detail.

The first two patches from the original patchset [1] are not backported
to 6.12.y as they are no-op in 6.12.y:

 - mm/slab: fix a memory leak due to bootstrapping sheaves twice
 - mm/slab: decouple SLAB_NO_SHEAVES from SLAB_NO_OBJ_EXT

[1] https://lore.kernel.org/all/[email protected]

To: Suren Baghdasaryan <[email protected]>
To: Andrew Morton <[email protected]>
To: Vlastimil Babka <[email protected]>
To: Christoph Lameter <[email protected]>
To: David Rientjes <[email protected]>
To: Roman Gushchin <[email protected]>
To: Harry Yoo <[email protected]>
To: Kees Cook <[email protected]>
To: Danielle Costantino <[email protected]>
To: Shakeel Butt <[email protected]>
To: Hao Ge <[email protected]>
To: Hao Li <[email protected]>
To: Pedro Falcato <[email protected]>,
To: "Liam R . Howlett" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Signed-off-by: Harry Yoo <[email protected]>
---
Harry Yoo (Oracle) (2):
      lib/alloc_tag: introduce mem_alloc_profiling_permanently_disabled()
      mm/slab: prevent unbounded recursion in free path with new kmalloc type

 include/linux/alloc_tag.h |  3 +++
 include/linux/slab.h      |  8 +++++++-
 lib/alloc_tag.c           |  9 +++++++++
 mm/slab.h                 | 28 ++++++++++++++++++++++++++--
 mm/slab_common.c          | 13 +++++++++++++
 mm/slub.c                 | 34 +++++++++++++++++++++++-----------
 6 files changed, 81 insertions(+), 14 deletions(-)
---
base-commit: 833291ee77846538926c990bcb468f6f54e9af50
change-id: 20260804-kmalloc-no-objext-for-6-12-y-bedd8e852aeb

Best regards,
-- 
Cheers,
Harry / Hyeonggon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.