ARM: 9430/1: entry: Do a dummy read from VMAP shadow
BugLink: https://bugs.launchpad.net/bugs/2101915
commit 44e9a3bb76e5f2eecd374c8176b2c5163c8bb2e2 upstream.
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: stable@vger.kernel.org
Fixes: a1c510d0ad ("ARM: implement support for vmap'ed stacks")
Link: https://lore.kernel.org/linux-arm-kernel/a1a1d062-f3a2-4d05-9836-3b098de9db6d@foss.st.com/
Reported-by: Clement LE GOFFIC <clement.legoffic@foss.st.com>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
8d9eef3053
commit
6676873aac
@@ -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>
|
||||
@@ -555,6 +556,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
|
||||
|
||||
Reference in New Issue
Block a user