Skip to content

Commit 3713e31

Browse files
hcahcasmb49
authored andcommitted
s390/entry: Fix last breaking event handling in case of stack corruption
BugLink: https://bugs.launchpad.net/bugs/2115252 [ Upstream commit ae952ee ] In case of stack corruption stack_invalid() is called and the expectation is that register r10 contains the last breaking event address. This dependency is quite subtle and broke a couple of years ago without that anybody noticed. Fix this by getting rid of the dependency and read the last breaking event address from lowcore. Fixes: 56e62a7 ("s390: convert to generic entry") Acked-by: Ilya Leoshkevich <[email protected]> Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 2ce841f commit 3713e31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/s390/kernel/entry.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ SYM_CODE_START(stack_overflow)
601601
stmg %r0,%r7,__PT_R0(%r11)
602602
stmg %r8,%r9,__PT_PSW(%r11)
603603
mvc __PT_R8(64,%r11),0(%r14)
604-
stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2
604+
GET_LC %r2
605+
mvc __PT_ORIG_GPR2(8,%r11),__LC_PGM_LAST_BREAK(%r2)
605606
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
606607
lgr %r2,%r11 # pass pointer to pt_regs
607608
jg kernel_stack_overflow

0 commit comments

Comments
 (0)