linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: always use SYSCALL_DEFINE*
@ 2018-03-10 20:55 Tautschnig, Michael
  2018-03-10 20:59 ` Tautschnig, Michael
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tautschnig, Michael @ 2018-03-10 20:55 UTC (permalink / raw)
  To: x86@kernel.org, linux-api@vger.kernel.org,
	linux-kernel@vger.kernel.org
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jaswinder Singh,
	Andi Kleen

All syscall arguments are passed in as types of the same byte size as
unsigned long (width of full registers). Using a smaller type without a
cast may result in losing bits of information. SYSCALL_DEFINE* introduce
adequate type casts. All definitions of syscalls in x86 except for those
patched here have already been using the appropriate SYSCALL_DEFINE*.

Signed-off-by: Michael Tautschnig <tautschn@amazon.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jaswinder Singh <jaswinder@infradead.org>
Cc: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/ioport.c | 3 ++-
 arch/x86/kernel/signal.c | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index 2f72330..d98b2a3 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -23,7 +23,8 @@
 /*
  * this changes the io permissions bitmap in the current task.
  */
-asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
+SYSCALL_DEFINE3(sys_ioperm, unsigned long, from, unsigned long, num, int,
+		turn_on)
 {
 	struct thread_struct *t = &current->thread;
 	struct tss_struct *tss;
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index b9e00e8..40ba242 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -25,6 +25,7 @@
 #include <linux/user-return-notifier.h>
 #include <linux/uprobes.h>
 #include <linux/context_tracking.h>
+#include <linux/syscalls.h>

 #include <asm/processor.h>
 #include <asm/ucontext.h>
@@ -601,7 +602,7 @@ static int x32_setup_rt_frame(struct ksignal *ksig,
  * Do a signal return; undo the signal stack.
  */
 #ifdef CONFIG_X86_32
-asmlinkage unsigned long sys_sigreturn(void)
+SYSCALL_DEFINE0(sigreturn)
 {
 	struct pt_regs *regs = current_pt_regs();
 	struct sigframe __user *frame;
@@ -633,7 +634,7 @@ asmlinkage unsigned long sys_sigreturn(void)
 }
 #endif /* CONFIG_X86_32 */

-asmlinkage long sys_rt_sigreturn(void)
+SYSCALL_DEFINE0(rt_sigreturn)
 {
 	struct pt_regs *regs = current_pt_regs();
 	struct rt_sigframe __user *frame;
--
2.7.3.AMZN



Amazon Web Services UK Limited. Registered in England and Wales with registration number 08650665 with its registered office at 1 Principal Place, Worship Street, London, EC2A 2FA, United Kingdom.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-14  9:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-10 20:55 [PATCH] x86: always use SYSCALL_DEFINE* Tautschnig, Michael
2018-03-10 20:59 ` Tautschnig, Michael
2018-03-11  9:43 ` [PATCH v2] " Tautschnig, Michael
2018-03-13 21:16 ` [PATCH] " Jann Horn
2018-03-13 23:18   ` Andy Lutomirski
2018-03-14  5:48     ` Dominik Brodowski
2018-03-14  9:43       ` Tautschnig, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).