aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/entry/vsyscall/vsyscall_64.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2021-10-20 12:44:03 -0500
committerEric W. Biederman <ebiederm@xmission.com>2021-10-29 14:31:34 -0500
commit695dd0d634df8903e5ead8aa08d326f63b23368a (patch)
tree1a50b133a243eb6ea86130cdae4de5aa868869b0 /arch/x86/entry/vsyscall/vsyscall_64.c
parentsignal/sparc32: In setup_rt_frame and setup_fram use force_fatal_sig (diff)
downloadlinux-dev-695dd0d634df8903e5ead8aa08d326f63b23368a.tar.xz
linux-dev-695dd0d634df8903e5ead8aa08d326f63b23368a.zip
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>
Diffstat (limited to 'arch/x86/entry/vsyscall/vsyscall_64.c')
-rw-r--r--arch/x86/entry/vsyscall/vsyscall_64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
index 1b40b9297083..0b6b277ee050 100644
--- a/arch/x86/entry/vsyscall/vsyscall_64.c
+++ b/arch/x86/entry/vsyscall/vsyscall_64.c
@@ -226,7 +226,8 @@ bool emulate_vsyscall(unsigned long error_code,
if ((!tmp && regs->orig_ax != syscall_nr) || regs->ip != address) {
warn_bad_vsyscall(KERN_DEBUG, regs,
"seccomp tried to change syscall nr or ip");
- do_exit(SIGSYS);
+ force_fatal_sig(SIGSYS);
+ return true;
}
regs->orig_ax = -1;
if (tmp)