Commit ae952eea authored by Heiko Carstens's avatar Heiko Carstens
Browse files

s390/entry: Fix last breaking event handling in case of stack corruption



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: 56e62a73 ("s390: convert to generic entry")
Acked-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent d2b8111c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -602,7 +602,8 @@ SYM_CODE_START(stack_invalid)
	stmg	%r0,%r7,__PT_R0(%r11)
	stmg	%r8,%r9,__PT_PSW(%r11)
	mvc	__PT_R8(64,%r11),0(%r14)
	stg	%r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2
	GET_LC	%r2
	mvc	__PT_ORIG_GPR2(8,%r11),__LC_PGM_LAST_BREAK(%r2)
	xc	__SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
	lgr	%r2,%r11		# pass pointer to pt_regs
	jg	kernel_stack_invalid