Skip to content

Commit 7fbaaca

Browse files
committed
Merge tag 'slab-for-6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull slab fixes from Vlastimil Babka: - Fix for a slub_kunit test warning with MEM_ALLOC_PROFILING_DEBUG (Pei Xiao) - Fix for a MTE-based KASAN BUG in krealloc() (Qun-Wei Lin) * tag 'slab-for-6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm: krealloc: Fix MTE false alarm in __do_krealloc slub/kunit: fix a WARNING due to unwrapped __kmalloc_cache_noprof
2 parents 9251e3e + 7045738 commit 7fbaaca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/slub_kunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void test_kmalloc_redzone_access(struct kunit *test)
141141
{
142142
struct kmem_cache *s = test_kmem_cache_create("TestSlub_RZ_kmalloc", 32,
143143
SLAB_KMALLOC|SLAB_STORE_USER|SLAB_RED_ZONE);
144-
u8 *p = __kmalloc_cache_noprof(s, GFP_KERNEL, 18);
144+
u8 *p = alloc_hooks(__kmalloc_cache_noprof(s, GFP_KERNEL, 18));
145145

146146
kasan_disable_current();
147147

mm/slab_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags)
12091209
/* Zero out spare memory. */
12101210
if (want_init_on_alloc(flags)) {
12111211
kasan_disable_current();
1212-
memset((void *)p + new_size, 0, ks - new_size);
1212+
memset(kasan_reset_tag(p) + new_size, 0, ks - new_size);
12131213
kasan_enable_current();
12141214
}
12151215

0 commit comments

Comments
 (0)