From: Sami Tolvanen <samitolvanen@google.com>
To: Andy Lutomirski <luto@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H . Peter Anvin" <hpa@zytor.com>,
Kees Cook <keescook@chromium.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH v2 3/5] x86: use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn
Date: Wed, 18 Sep 2019 15:46:06 -0700 [thread overview]
Message-ID: <20190918224608.77973-4-samitolvanen@google.com> (raw)
In-Reply-To: <20190918224608.77973-1-samitolvanen@google.com>
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: Sami Tolvanen <samitolvanen@google.com>
---
arch/x86/entry/syscalls/syscall_32.tbl | 4 ++--
arch/x86/ia32/ia32_signal.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
index 3fe02546aed3..2de75fda1d20 100644
--- a/arch/x86/entry/syscalls/syscall_32.tbl
+++ b/arch/x86/entry/syscalls/syscall_32.tbl
@@ -130,7 +130,7 @@
116 i386 sysinfo sys_sysinfo __ia32_compat_sys_sysinfo
117 i386 ipc sys_ipc __ia32_compat_sys_ipc
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
121 i386 setdomainname sys_setdomainname __ia32_sys_setdomainname
122 i386 uname sys_newuname __ia32_sys_newuname
@@ -184,7 +184,7 @@
170 i386 setresgid sys_setresgid16 __ia32_sys_setresgid16
171 i386 getresgid sys_getresgid16 __ia32_sys_getresgid16
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
175 i386 rt_sigprocmask sys_rt_sigprocmask __ia32_compat_sys_rt_sigprocmask
176 i386 rt_sigpending sys_rt_sigpending __ia32_compat_sys_rt_sigpending
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 1cee10091b9f..30416d7f19d4 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -21,6 +21,7 @@
#include <linux/personality.h>
#include <linux/compat.h>
#include <linux/binfmts.h>
+#include <linux/syscalls.h>
#include <asm/ucontext.h>
#include <linux/uaccess.h>
#include <asm/fpu/internal.h>
@@ -118,7 +119,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
return err;
}
-asmlinkage long sys32_sigreturn(void)
+COMPAT_SYSCALL_DEFINE0(sigreturn)
{
struct pt_regs *regs = current_pt_regs();
struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8);
@@ -144,7 +145,7 @@ asmlinkage long sys32_sigreturn(void)
return 0;
}
-asmlinkage long sys32_rt_sigreturn(void)
+COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
{
struct pt_regs *regs = current_pt_regs();
struct rt_sigframe_ia32 __user *frame;
--
2.23.0.351.gc4317032e6-goog
next prev parent reply other threads:[~2019-09-18 22:46 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 21:00 [PATCH 0/4] x86: fix syscall function type mismatches Sami Tolvanen
2019-09-13 21:00 ` [PATCH 1/4] x86: use the correct function type in SYSCALL_DEFINE0 Sami Tolvanen
2019-09-13 22:33 ` Andy Lutomirski
2019-09-13 21:00 ` [PATCH 2/4] x86: use the correct function type for sys32_(rt_)sigreturn Sami Tolvanen
2019-09-13 22:44 ` Andy Lutomirski
2019-09-13 23:29 ` Sami Tolvanen
2019-09-13 21:00 ` [PATCH 3/4] x86: use the correct function type for sys_ni_syscall Sami Tolvanen
2019-09-13 22:45 ` Andy Lutomirski
2019-09-13 23:26 ` Sami Tolvanen
2019-09-14 0:27 ` Andy Lutomirski
2019-09-16 20:43 ` Will Deacon
2019-09-13 21:00 ` [PATCH 4/4] x86: fix function types in COND_SYSCALL Sami Tolvanen
2019-09-13 22:46 ` Andy Lutomirski
2019-09-13 23:28 ` Sami Tolvanen
2019-09-14 0:28 ` Andy Lutomirski
2019-09-17 22:44 ` Sami Tolvanen
2019-09-18 22:46 ` [PATCH v2 0/5] x86: fix syscall function type mismatches Sami Tolvanen
2019-09-18 22:46 ` [PATCH v2 1/5] x86: use the correct function type in SYSCALL_DEFINE0 Sami Tolvanen
2019-09-18 22:46 ` [PATCH v2 2/5] x86/syscalls: Wire up COMPAT_SYSCALL_DEFINE0 Sami Tolvanen
2019-09-18 22:46 ` Sami Tolvanen [this message]
2019-09-18 22:46 ` [PATCH v2 4/5] x86: use the correct function type for sys_ni_syscall Sami Tolvanen
2019-09-18 22:46 ` [PATCH v2 5/5] x86: fix function types in COND_SYSCALL Sami Tolvanen
2019-10-08 22:40 ` [RESEND PATCH v2 0/5] x86: fix syscall function type mismatches Sami Tolvanen
2019-10-08 22:40 ` [RESEND PATCH v2 1/5] x86: use the correct function type in SYSCALL_DEFINE0 Sami Tolvanen
2019-10-11 11:22 ` [tip: x86/entry] syscalls/x86: Use " tip-bot2 for Sami Tolvanen
2019-10-08 22:40 ` [RESEND PATCH v2 2/5] x86/syscalls: Wire up COMPAT_SYSCALL_DEFINE0 Sami Tolvanen
2019-10-11 11:22 ` [tip: x86/entry] syscalls/x86: " tip-bot2 for Andy Lutomirski
2019-10-08 22:40 ` [RESEND PATCH v2 3/5] x86: use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn Sami Tolvanen
2019-10-11 11:22 ` [tip: x86/entry] syscalls/x86: Use " tip-bot2 for Sami Tolvanen
2019-10-08 22:40 ` [RESEND PATCH v2 4/5] x86: use the correct function type for sys_ni_syscall Sami Tolvanen
2019-10-11 11:22 ` [tip: x86/entry] syscalls/x86: Use " tip-bot2 for Sami Tolvanen
2019-10-08 22:40 ` [RESEND PATCH v2 5/5] x86: fix function types in COND_SYSCALL Sami Tolvanen
2019-10-11 11:22 ` [tip: x86/entry] syscalls/x86: Fix " tip-bot2 for Sami Tolvanen
2019-10-10 18:17 ` [RESEND PATCH v2 0/5] x86: fix syscall function type mismatches Andy Lutomirski
2019-10-11 10:50 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190918224608.77973-4-samitolvanen@google.com \
--to=samitolvanen@google.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox