From: Greg Kroah-Hartman Date: Mon, 16 Aug 2021 12:14:15 +0000 (+0200) Subject: 5.13-stable patches X-Git-Tag: v5.4.142~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9a230e18fc04b3da980140f1e0245817ddedc3e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.13-stable patches added patches: kasan-slub-reset-tag-when-printing-address.patch --- 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 index 00000000000..60514383069 --- /dev/null +++ b/queue-5.13/kasan-slub-reset-tag-when-printing-address.patch @@ -0,0 +1,45 @@ +From 340caf178ddc2efb0294afaf54c715f7928c258e Mon Sep 17 00:00:00 2001 +From: Kuan-Ying Lee +Date: Fri, 13 Aug 2021 16:54:27 -0700 +Subject: kasan, slub: reset tag when printing address + +From: Kuan-Ying Lee + +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 +Reviewed-by: Marco Elver +Reviewed-by: Andrey Konovalov +Cc: Alexander Potapenko +Cc: Andrey Ryabinin +Cc: Catalin Marinas +Cc: Chinwen Chang +Cc: Nicholas Tang +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + 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(); + } + diff --git a/queue-5.13/series b/queue-5.13/series index b3eb4ec0a2a..9a1098485c5 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -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