Commit 00198a6e authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Ingo Molnar

syscalls/x86: Use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn

Use COMPAT_SYSCALL_DEFINE0 to define (rt_)sigreturn() syscalls to
replace sys32_sigreturn() and sys32_rt_sigreturn(). This fixes indirect
call mismatches with Control-Flow Integrity (CFI) checking.
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H . Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191008224049.115427-4-samitolvanen@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent cf3b83e1
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
116 i386 sysinfo sys_sysinfo __ia32_compat_sys_sysinfo 116 i386 sysinfo sys_sysinfo __ia32_compat_sys_sysinfo
117 i386 ipc sys_ipc __ia32_compat_sys_ipc 117 i386 ipc sys_ipc __ia32_compat_sys_ipc
118 i386 fsync sys_fsync __ia32_sys_fsync 118 i386 fsync sys_fsync __ia32_sys_fsync
119 i386 sigreturn sys_sigreturn sys32_sigreturn 119 i386 sigreturn sys_sigreturn __ia32_compat_sys_sigreturn
120 i386 clone sys_clone __ia32_compat_sys_x86_clone 120 i386 clone sys_clone __ia32_compat_sys_x86_clone
121 i386 setdomainname sys_setdomainname __ia32_sys_setdomainname 121 i386 setdomainname sys_setdomainname __ia32_sys_setdomainname
122 i386 uname sys_newuname __ia32_sys_newuname 122 i386 uname sys_newuname __ia32_sys_newuname
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
170 i386 setresgid sys_setresgid16 __ia32_sys_setresgid16 170 i386 setresgid sys_setresgid16 __ia32_sys_setresgid16
171 i386 getresgid sys_getresgid16 __ia32_sys_getresgid16 171 i386 getresgid sys_getresgid16 __ia32_sys_getresgid16
172 i386 prctl sys_prctl __ia32_sys_prctl 172 i386 prctl sys_prctl __ia32_sys_prctl
173 i386 rt_sigreturn sys_rt_sigreturn sys32_rt_sigreturn 173 i386 rt_sigreturn sys_rt_sigreturn __ia32_compat_sys_rt_sigreturn
174 i386 rt_sigaction sys_rt_sigaction __ia32_compat_sys_rt_sigaction 174 i386 rt_sigaction sys_rt_sigaction __ia32_compat_sys_rt_sigaction
175 i386 rt_sigprocmask sys_rt_sigprocmask __ia32_compat_sys_rt_sigprocmask 175 i386 rt_sigprocmask sys_rt_sigprocmask __ia32_compat_sys_rt_sigprocmask
176 i386 rt_sigpending sys_rt_sigpending __ia32_compat_sys_rt_sigpending 176 i386 rt_sigpending sys_rt_sigpending __ia32_compat_sys_rt_sigpending
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/binfmts.h> #include <linux/binfmts.h>
#include <linux/syscalls.h>
#include <asm/ucontext.h> #include <asm/ucontext.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/fpu/internal.h> #include <asm/fpu/internal.h>
...@@ -118,7 +119,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs, ...@@ -118,7 +119,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
return err; return err;
} }
asmlinkage long sys32_sigreturn(void) COMPAT_SYSCALL_DEFINE0(sigreturn)
{ {
struct pt_regs *regs = current_pt_regs(); struct pt_regs *regs = current_pt_regs();
struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8); struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8);
...@@ -144,7 +145,7 @@ asmlinkage long sys32_sigreturn(void) ...@@ -144,7 +145,7 @@ asmlinkage long sys32_sigreturn(void)
return 0; return 0;
} }
asmlinkage long sys32_rt_sigreturn(void) COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
{ {
struct pt_regs *regs = current_pt_regs(); struct pt_regs *regs = current_pt_regs();
struct rt_sigframe_ia32 __user *frame; struct rt_sigframe_ia32 __user *frame;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment