Commit e64a1618 authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens
Browse files

s390: fix system call single stepping



When single stepping an svc instruction on s390, the kernel is entered
with a PER program check interruption. The program check handler than
jumps to the system call handler by reloading the PSW. The code didn't
set GPR13 to the thread pointer in struct task_struct. This made the
kernel access invalid memory while trying to fetch the syscall function
address. Fix this by always assigned GPR13 after .Lsysc_per.

Fixes: 0b0ed657 ("s390: remove critical section cleanup from entry.S")
Reported-and-tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 48778464
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -378,9 +378,9 @@ ENTRY(system_call)
	stmg	%r8,%r15,__LC_SAVE_AREA_SYNC
	BPOFF
	lg	%r12,__LC_CURRENT
	lghi	%r13,__TASK_thread
	lghi	%r14,_PIF_SYSCALL
.Lsysc_per:
	lghi	%r13,__TASK_thread
	lg	%r15,__LC_KERNEL_STACK
	la	%r11,STACK_FRAME_OVERHEAD(%r15)	# pointer to pt_regs
	UPDATE_VTIME %r8,%r9,__LC_SYNC_ENTER_TIMER