]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/slab: mark alloc tags empty for sheaves allocated with __GFP_NO_OBJ_EXT
authorSuren Baghdasaryan <surenb@google.com>
Wed, 25 Feb 2026 16:34:07 +0000 (08:34 -0800)
committerVlastimil Babka (SUSE) <vbabka@kernel.org>
Thu, 26 Feb 2026 16:30:32 +0000 (17:30 +0100)
commitf3ec502b6755a3bfb12c1c47025ef989ff9efc72
treeaaba4a7b224ee71e36c6ebb9de37b055b4524687
parent021ca6b670bebebc409d43845efcfe8c11c1dd54
mm/slab: mark alloc tags empty for sheaves allocated with __GFP_NO_OBJ_EXT

alloc_empty_sheaf() allocates sheaves from SLAB_KMALLOC caches using
__GFP_NO_OBJ_EXT to avoid recursion, however it does not mark their
allocation tags empty before freeing, which results in a warning when
CONFIG_MEM_ALLOC_PROFILING_DEBUG is set. Fix this by marking allocation
tags for such sheaves as empty.

The problem was technically introduced in commit 4c0a17e28340 but only
becomes possible to hit with commit 913ffd3a1bf5.

Fixes: 4c0a17e28340 ("slab: prevent recursive kmalloc() in alloc_empty_sheaf()")
Fixes: 913ffd3a1bf5 ("slab: handle kmalloc sheaves bootstrap")
Reported-by: David Wang <00107082@163.com>
Closes: https://lore.kernel.org/all/20260223155128.3849-1-00107082@163.com/
Analyzed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Tested-by: Harry Yoo <harry.yoo@oracle.com>
Tested-by: David Wang <00107082@163.com>
Link: https://patch.msgid.link/20260225163407.2218712-1-surenb@google.com
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
include/linux/gfp_types.h
mm/slab.h
mm/slub.c