Skip to content

Commit 4ac24c0

Browse files
author
Vasily Gorbik
committed
s390: fix register clobbering in CALL_ON_STACK
CALL_ON_STACK defines and initializes register variables. Inline assembly which follows might trigger compiler to generate memory access for "stack" argument (e.g. in case of S390_lowcore.nodat_stack). This memory access produces a function call under kasan with outline instrumentation which clobbers registers. Switch "stack" argument in CALL_ON_STACK helper to use memory reference constraint and perform load instead. Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent f44fa79 commit 4ac24c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/s390/include/asm/stacktrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ struct stack_frame {
112112
\
113113
asm volatile( \
114114
" la %[_prev],0(15)\n" \
115-
" la 15,0(%[_stack])\n" \
115+
" lg 15,%[_stack]\n" \
116116
" stg %[_frame],%[_bc](15)\n" \
117117
" brasl 14,%[_fn]\n" \
118118
" la 15,0(%[_prev])\n" \
119119
: [_prev] "=&a" (prev), CALL_FMT_##nr \
120-
[_stack] "a" (stack), \
120+
[_stack] "R" (stack), \
121121
[_bc] "i" (offsetof(struct stack_frame, back_chain)), \
122122
[_frame] "d" (frame), \
123123
[_fn] "X" (fn) : CALL_CLOBBER_##nr); \

0 commit comments

Comments
 (0)