Skip to contentSkip to conversation

kasan-mm-untag-page-address-in-free_reserved_area.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 23, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: kasan, mm: untag page address in free_reserved_area
has been removed from the -mm tree. Its filename was
kasan-mm-untag-page-address-in-free_reserved_area.patch

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

------------------------------------------------------
From: Vincenzo Frascino <[email protected]>
Subject: kasan, mm: untag page address in free_reserved_area

free_reserved_area() memsets the pages belonging to a given memory area. As that memory hasn't been allocated via page_alloc, the KASAN tags that those pages have are 0x00. As the result the memset might result in a tag mismatch.

Untag the address to avoid spurious faults.

---

 mm/page_alloc.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/page_alloc.c renamed from mm/page_alloc.c~kasan-mm-untag-page-address-in-free_reserved_area +5 -0
@@ -7671,6 +7671,11 @@ unsigned long free_reserved_area(void *s
 		 * alias for the memset().
 		 */
 		direct_map_addr = page_address(page);
+		/*
+		 * Perform a kasan-unchecked memset() since this memory
+		 * has not been initialized.
+		 */
+		direct_map_addr = kasan_reset_tag(direct_map_addr);
 		if ((unsigned int)poison <= 0xFF)
 			memset(direct_map_addr, poison, PAGE_SIZE);
 

_

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