Commit ac1256f8 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky

s390/kasan: reipl and kexec support

Some functions from both arch/s390/kernel/ipl.c and
arch/s390/kernel/machine_kexec.c are called without DAT enabled
(or with and without DAT enabled code paths). There is no easy way
to partially disable kasan for those files without a substantial
rework. Disable kasan for both files for now.

To avoid disabling kasan for arch/s390/kernel/diag.c DAT flag is
enabled in diag308 call. pcpu_delegate which disables DAT is marked
with __no_sanitize_address to disable instrumentation for that one
function.
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9e8df6da
...@@ -242,7 +242,7 @@ static inline unsigned long current_stack_pointer(void) ...@@ -242,7 +242,7 @@ static inline unsigned long current_stack_pointer(void)
return sp; return sp;
} }
static inline unsigned short stap(void) static __no_sanitize_address_or_inline unsigned short stap(void)
{ {
unsigned short cpu_address; unsigned short cpu_address;
......
...@@ -24,6 +24,8 @@ UBSAN_SANITIZE_early.o := n ...@@ -24,6 +24,8 @@ UBSAN_SANITIZE_early.o := n
UBSAN_SANITIZE_early_nobss.o := n UBSAN_SANITIZE_early_nobss.o := n
KASAN_SANITIZE_early_nobss.o := n KASAN_SANITIZE_early_nobss.o := n
KASAN_SANITIZE_ipl.o := n
KASAN_SANITIZE_machine_kexec.o := n
# #
# Passing null pointers is ok for smp code, since we access the lowcore here. # Passing null pointers is ok for smp code, since we access the lowcore here.
......
...@@ -156,6 +156,8 @@ static inline int __diag308(unsigned long subcode, void *addr) ...@@ -156,6 +156,8 @@ static inline int __diag308(unsigned long subcode, void *addr)
int diag308(unsigned long subcode, void *addr) int diag308(unsigned long subcode, void *addr)
{ {
if (IS_ENABLED(CONFIG_KASAN))
__arch_local_irq_stosm(0x04); /* enable DAT */
diag_stat_inc(DIAG_STAT_X308); diag_stat_inc(DIAG_STAT_X308);
return __diag308(subcode, addr); return __diag308(subcode, addr);
} }
......
...@@ -313,8 +313,9 @@ static void __pcpu_delegate(void (*func)(void*), void *data) ...@@ -313,8 +313,9 @@ static void __pcpu_delegate(void (*func)(void*), void *data)
func(data); /* should not return */ func(data); /* should not return */
} }
static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), static void __no_sanitize_address pcpu_delegate(struct pcpu *pcpu,
void *data, unsigned long stack) void (*func)(void *),
void *data, unsigned long stack)
{ {
struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices];
unsigned long source_cpu = stap(); unsigned long source_cpu = stap();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment