]> Git Repo - J-linux.git/commitdiff
ARM: 9430/1: entry: Do a dummy read from VMAP shadow
authorLinus Walleij <[email protected]>
Wed, 23 Oct 2024 12:04:44 +0000 (13:04 +0100)
committerRussell King (Oracle) <[email protected]>
Wed, 13 Nov 2024 08:15:23 +0000 (08:15 +0000)
When switching task, in addition to a dummy read from the new
VMAP stack, also do a dummy read from the VMAP stack's
corresponding KASAN shadow memory to sync things up in
the new MM context.

Cc: [email protected]
Fixes: a1c510d0adc6 ("ARM: implement support for vmap'ed stacks")
Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Reported-by: Clement LE GOFFIC <[email protected]>
Suggested-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
arch/arm/kernel/entry-armv.S

index 1dfae1af8e31b0e8bed99947baaf0a43b86cf923..ef6a657c8d130663e68acd07226815ce8a3fff7d 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/tls.h>
 #include <asm/system_info.h>
 #include <asm/uaccess-asm.h>
+#include <asm/kasan_def.h>
 
 #include "entry-header.S"
 #include <asm/probes.h>
@@ -561,6 +562,13 @@ ENTRY(__switch_to)
        @ entries covering the vmalloc region.
        @
        ldr     r2, [ip]
+#ifdef CONFIG_KASAN_VMALLOC
+       @ Also dummy read from the KASAN shadow memory for the new stack if we
+       @ are using KASAN
+       mov_l   r2, KASAN_SHADOW_OFFSET
+       add     r2, r2, ip, lsr #KASAN_SHADOW_SCALE_SHIFT
+       ldr     r2, [r2]
+#endif
 #endif
 
        @ When CONFIG_THREAD_INFO_IN_TASK=n, the update of SP itself is what
This page took 0.052489 seconds and 4 git commands to generate.