]> Git Repo - linux.git/commit
s390: current_stack_pointer shouldn't be a function
authorSven Schnelle <[email protected]>
Fri, 8 Apr 2022 12:51:26 +0000 (14:51 +0200)
committerHeiko Carstens <[email protected]>
Tue, 12 Apr 2022 09:56:08 +0000 (11:56 +0200)
commit30de14b1884ba609fc1acfba5b40309e3a6ccefe
tree6196ce347eb977a4d787615260264a3255274d4d
parenta25d5887821e242e5ea8388d8461ff20bedb0729
s390: current_stack_pointer shouldn't be a function

s390 defines current_stack_pointer as function while all other
architectures use 'register unsigned long asm("<stackptr reg>").

This make codes like the following from check_stack_object() fail:

if (IS_ENABLED(CONFIG_STACK_GROWSUP)) {
if ((void *)current_stack_pointer < obj + len)
return BAD_STACK;
} else {
if (obj < (void *)current_stack_pointer)
return BAD_STACK;
}

because this would compare the address of current_stack_pointer() and
not the stackpointer value.

Reported-by: Karsten Graul <[email protected]>
Fixes: 2792d84e6da5 ("usercopy: Check valid lifetime via stack depth")
Cc: Kees Cook <[email protected]>
Cc: Vasily Gorbik <[email protected]>
Cc: Alexander Gordeev <[email protected]>
Signed-off-by: Sven Schnelle <[email protected]>
Reviewed-by: Heiko Carstens <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
arch/s390/include/asm/entry-common.h
arch/s390/include/asm/processor.h
arch/s390/include/asm/stacktrace.h
arch/s390/lib/test_unwind.c
This page took 0.060636 seconds and 4 git commands to generate.