Skip to contentSkip to conversation

kasan-fix-tag-for-large-allocations-when-using-config_slab.patch removed from -mm tree

merged [email protected] 1 participant 1 message Nov 11, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: kasan: fix tag for large allocations when using CONFIG_SLAB
has been removed from the -mm tree. Its filename was
kasan-fix-tag-for-large-allocations-when-using-config_slab.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: "Matthew Wilcox (Oracle)" <[email protected]>
Subject: kasan: fix tag for large allocations when using CONFIG_SLAB

If an object is allocated on a tail page of a multi-page slab, kasan will get the wrong tag because page->s_mem is NULL for tail pages. I'm not quite sure what the user-visible effect of this might be.

Fixes 7f94ffbc4c6a ("kasan: add hooks implementation for tag-based mode")
Cc Andrey Ryabinin <[email protected]>
Cc Alexander Potapenko <[email protected]>
Cc Dmitry Vyukov <[email protected]>

---

 mm/kasan/common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kasan/common.c renamed from mm/kasan/common.c~kasan-fix-tag-for-large-allocations-when-using-config_slab +1 -1
@@ -298,7 +298,7 @@ static inline u8 assign_tag(struct kmem_
 	/* For caches that either have a constructor or SLAB_TYPESAFE_BY_RCU: */
 #ifdef CONFIG_SLAB
 	/* For SLAB assign tags based on the object index in the freelist. */
-	return (u8)obj_to_index(cache, virt_to_page(object), (void *)object);
+	return (u8)obj_to_index(cache, virt_to_head_page(object), (void *)object);
 #else
 	/*
 	 * For SLUB assign a random tag during slab creation, otherwise reuse

_

Patches currently in -mm which might be from [email protected] are

hitting-bug_on-trap-in-read_pages-mm-optimise-put_pages_list.patch