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

Harry Yoo (Oracle) posted 2 patches 2 months ago
There is a newer version of this series
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                 | 76 +++++++++++++++--------------------------------
6 files changed, 82 insertions(+), 55 deletions(-)
[PATCH 6.18.y 0/2] mm/slab: fix unbounded recursion in free path with memalloc profiling
Posted by Harry Yoo (Oracle) 2 months ago
This is backport of "mm/slab: fix unbounded recursion in free path with
memalloc profiling" series [1] for 6.18.y.

The last patch has a slight functional difference compared to mainline
due to lack of SLAB_ALLOC_* flags. I described those subtlties in the
backporting notes in detail.

The first two patches from the patchset are not backported to 6.18.y
as they are no-op in 6.18.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/20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org

To: Suren Baghdasaryan <surenb@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
To: Vlastimil Babka <vbabka@kernel.org>
To: Christoph Lameter <cl@gentwo.org>
To: David Rientjes <rientjes@google.com>
To: Roman Gushchin <roman.gushchin@linux.dev>
To: Harry Yoo <harry@kernel.org>
To: Kees Cook <kees@kernel.org>
To: Danielle Costantino <dcostantino@meta.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
To: Hao Ge <hao.ge@linux.dev>
To: Hao Li <hao.li@linux.dev>
To: Pedro Falcato <pfalcato@suse.de>,
To: "Liam R . Howlett" <liam@infradead.org>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org

Signed-off-by: Harry Yoo <harry@kernel.org>
---
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                 | 76 +++++++++++++++--------------------------------
 6 files changed, 82 insertions(+), 55 deletions(-)
---
base-commit: 2fe596715f840d053aed5cee5455f701bdcd2b50
change-id: 20260803-kmalloc-no-objext-for-6-18-y-5e297a8bd9c1

Best regards,
-- 
Cheers,
Harry / Hyeonggon
Re: [PATCH 6.18.y 0/2] mm/slab: fix unbounded recursion in free path with memalloc profiling
Posted by Sasha Levin 1 month, 4 weeks ago
On Mon, Aug 03, 2026 at 07:15:09AM +0000, Harry Yoo (Oracle) wrote:
> This is backport of "mm/slab: fix unbounded recursion in free path with
> memalloc profiling" series [1] for 6.18.y.
>
> The last patch has a slight functional difference compared to mainline
> due to lack of SLAB_ALLOC_* flags. I described those subtlties in the
> backporting notes in detail.

Queued the series for 6.18, thanks.

-- 
Thanks,
Sasha