Thread (7 messages) 7 messages, 4 authors, 2018-03-14

Re: [PATCH] x86: always use SYSCALL_DEFINE*

From: Jann Horn <jannh@google.com>
Date: 2018-03-13 21:16:24
Also in: lkml

On Sat, Mar 10, 2018 at 12:55 PM, Tautschnig, Michael
[off-list ref] wrote:
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*.
[...]
quoted hunk ↗ jump to hunk
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)
Shouldn't this be "SYSCALL_DEFINE3(ioperm, [...]", without the "sys_"?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help