Skip to content

Commit 44e9a3b

Browse files
linuswRussell King (Oracle)
authored andcommitted
ARM: 9430/1: entry: Do a dummy read from VMAP shadow
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: a1c510d ("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]>
1 parent d6e6a74 commit 44e9a3b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/arm/kernel/entry-armv.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <asm/tls.h>
2626
#include <asm/system_info.h>
2727
#include <asm/uaccess-asm.h>
28+
#include <asm/kasan_def.h>
2829

2930
#include "entry-header.S"
3031
#include <asm/probes.h>
@@ -561,6 +562,13 @@ ENTRY(__switch_to)
561562
@ entries covering the vmalloc region.
562563
@
563564
ldr r2, [ip]
565+
#ifdef CONFIG_KASAN_VMALLOC
566+
@ Also dummy read from the KASAN shadow memory for the new stack if we
567+
@ are using KASAN
568+
mov_l r2, KASAN_SHADOW_OFFSET
569+
add r2, r2, ip, lsr #KASAN_SHADOW_SCALE_SHIFT
570+
ldr r2, [r2]
571+
#endif
564572
#endif
565573

566574
@ When CONFIG_THREAD_INFO_IN_TASK=n, the update of SP itself is what

0 commit comments

Comments
 (0)