]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Aug 2021 12:14:15 +0000 (14:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Aug 2021 12:14:15 +0000 (14:14 +0200)
added patches:
kasan-slub-reset-tag-when-printing-address.patch

queue-5.13/kasan-slub-reset-tag-when-printing-address.patch [new file with mode: 0644]
queue-5.13/series

diff --git a/queue-5.13/kasan-slub-reset-tag-when-printing-address.patch b/queue-5.13/kasan-slub-reset-tag-when-printing-address.patch
new file mode 100644 (file)
index 0000000..6051438
--- /dev/null
@@ -0,0 +1,45 @@
+From 340caf178ddc2efb0294afaf54c715f7928c258e Mon Sep 17 00:00:00 2001
+From: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
+Date: Fri, 13 Aug 2021 16:54:27 -0700
+Subject: kasan, slub: reset tag when printing address
+
+From: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
+
+commit 340caf178ddc2efb0294afaf54c715f7928c258e upstream.
+
+The address still includes the tags when it is printed.  With hardware
+tag-based kasan enabled, we will get a false positive KASAN issue when
+we access metadata.
+
+Reset the tag before we access the metadata.
+
+Link: https://lkml.kernel.org/r/20210804090957.12393-3-Kuan-Ying.Lee@mediatek.com
+Fixes: aa1ef4d7b3f6 ("kasan, mm: reset tags when accessing metadata")
+Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
+Reviewed-by: Marco Elver <elver@google.com>
+Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
+Cc: Alexander Potapenko <glider@google.com>
+Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Chinwen Chang <chinwen.chang@mediatek.com>
+Cc: Nicholas Tang <nicholas.tang@mediatek.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/slub.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/mm/slub.c
++++ b/mm/slub.c
+@@ -551,8 +551,8 @@ static void print_section(char *level, c
+                         unsigned int length)
+ {
+       metadata_access_enable();
+-      print_hex_dump(level, kasan_reset_tag(text), DUMP_PREFIX_ADDRESS,
+-                      16, 1, addr, length, 1);
++      print_hex_dump(level, text, DUMP_PREFIX_ADDRESS,
++                      16, 1, kasan_reset_tag((void *)addr), length, 1);
+       metadata_access_disable();
+ }
index b3eb4ec0a2a83f1d9daaae5c0b6086e9ce94cb80..9a1098485c5213f9c0c57ca749a28a0f6e14393d 100644 (file)
@@ -148,3 +148,4 @@ kvm-x86-mmu-protect-marking-sps-unsync-when-using-tdp-mmu-with-spinlock.patch
 ceph-add-some-lockdep-assertions-around-snaprealm-handling.patch
 ceph-clean-up-locking-annotation-for-ceph_get_snap_realm-and-__lookup_snap_realm.patch
 ceph-take-snap_empty_lock-atomically-with-snaprealm-refcount-change.patch
+kasan-slub-reset-tag-when-printing-address.patch