Skip to content

Commit 9bc508c

Browse files
committed
signal/s390: Use force_sigsegv in default_trap_handler
Reading the history it is unclear why default_trap_handler calls do_exit. It is not even menthioned in the commit where the change happened. My best guess is that because it is unknown why the exception happened it was desired to guarantee the process never returned to userspace. Using do_exit(SIGSEGV) has the problem that it will only terminate one thread of a process, leaving the process in an undefined state. Use force_sigsegv(SIGSEGV) instead which effectively has the same behavior except that is uses the ordinary signal mechanism and terminates all threads of a process and is generally well defined. Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: [email protected] Fixes: ca2ab03 ("[PATCH] s390: core changes") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Reviewed-by: Christian Borntraeger <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Eric W. Biederman <[email protected]>
1 parent 1fbd60d commit 9bc508c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void default_trap_handler(struct pt_regs *regs)
8484
{
8585
if (user_mode(regs)) {
8686
report_user_fault(regs, SIGSEGV, 0);
87-
do_exit(SIGSEGV);
87+
force_sigsegv(SIGSEGV);
8888
} else
8989
die(regs, "Unknown program exception");
9090
}

0 commit comments

Comments
 (0)