Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

signal/x86: In emulate_vsyscall force a signal instead of calling do_exit

Directly calling do_exit with a signal number has the problem that
all of the side effects of the signal don't happen, such as
killing all of the threads of a process instead of just the
calling thread.

So replace do_exit(SIGSYS) with force_fatal_sig(SIGSYS) which
causes the signal handling to take it's normal path and work
as expected.

Cc: Andy Lutomirski <luto@kernel.org>
Link: https://lkml.kernel.org/r/20211020174406.17889-17-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

+2 -1
+2 -1
arch/x86/entry/vsyscall/vsyscall_64.c
··· 226 226 if ((!tmp && regs->orig_ax != syscall_nr) || regs->ip != address) { 227 227 warn_bad_vsyscall(KERN_DEBUG, regs, 228 228 "seccomp tried to change syscall nr or ip"); 229 - do_exit(SIGSYS); 229 + force_fatal_sig(SIGSYS); 230 + return true; 230 231 } 231 232 regs->orig_ax = -1; 232 233 if (tmp)