Skip to contentSkip to conversation

kasan-check-object_size-in-kasan_complete_mode_report_info.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Dec 11, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: kasan: check object_size in kasan_complete_mode_report_info
has been removed from the -mm tree. Its filename was
kasan-check-object_size-in-kasan_complete_mode_report_info.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Andrey Konovalov <[email protected]>
Subject: kasan: check object_size in kasan_complete_mode_report_info
Date: Mon, 20 Nov 2023 18:47:17 +0100

Check the object size when looking up entries in the stack ring.

If the size of the object for which a report is being printed does not match the size of the object for which a stack trace has been saved in the stack ring, the saved stack trace is irrelevant.

---

 mm/kasan/report_tags.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/kasan/report_tags.c renamed from mm/kasan/report_tags.c~kasan-check-object_size-in-kasan_complete_mode_report_info +3 -1
@@ -7,6 +7,7 @@
 #include <linux/atomic.h>
 
 #include "kasan.h"
+#include "../slab.h"
 
 extern struct kasan_stack_ring stack_ring;
 
@@ -58,7 +59,8 @@ void kasan_complete_mode_report_info(str
 		entry = &stack_ring.entries[i % stack_ring.size];
 
 		if (kasan_reset_tag(entry->ptr) != info->object ||
-		    get_tag(entry->ptr) != get_tag(info->access_addr))
+		    get_tag(entry->ptr) != get_tag(info->access_addr) ||
+		    info->cache->object_size != entry->size)
 			continue;
 
 		if (entry->is_free) {

_

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