aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-10 12:21:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-10 12:21:05 -0400
commit3644bc2ec7655a249612ea500e2be1c13052c4c2 (patch)
tree872dabd511e62b7e94f3d903d7b55114175f5b06 /arch/x86
parent6fad8d02ef9ab12d5e178014a4c5c297e1707f23 (diff)
parentc5ddd2024a87353f73068732cfd38d3dfec22e87 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull stray syscall bits from Al Viro: "Several syscall-related commits that were missing from the original" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: switch compat_sys_sysctl to COMPAT_SYSCALL_DEFINE unicore32: just use mmap_pgoff()... unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...)
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/ia32/sys_ia32.c9
-rw-r--r--arch/x86/include/asm/sys_ia32.h3
-rw-r--r--arch/x86/include/asm/syscalls.h4
-rw-r--r--arch/x86/kernel/vm86_32.c38
-rw-r--r--arch/x86/syscalls/syscall_32.tbl2
5 files changed, 17 insertions, 39 deletions
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 4e4907c67d92..8e0ceecdc957 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -243,12 +243,3 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_lo,
243 return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo, 243 return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo,
244 ((u64)len_hi << 32) | len_lo); 244 ((u64)len_hi << 32) | len_lo);
245} 245}
246
247asmlinkage long sys32_fanotify_mark(int fanotify_fd, unsigned int flags,
248 u32 mask_lo, u32 mask_hi,
249 int fd, const char __user *pathname)
250{
251 return sys_fanotify_mark(fanotify_fd, flags,
252 ((u64)mask_hi << 32) | mask_lo,
253 fd, pathname);
254}
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 0ef202e232d6..82c34ee25a65 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -50,9 +50,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned,
50asmlinkage long sys32_sigreturn(void); 50asmlinkage long sys32_sigreturn(void);
51asmlinkage long sys32_rt_sigreturn(void); 51asmlinkage long sys32_rt_sigreturn(void);
52 52
53asmlinkage long sys32_fanotify_mark(int, unsigned int, u32, u32, int,
54 const char __user *);
55
56#endif /* CONFIG_COMPAT */ 53#endif /* CONFIG_COMPAT */
57 54
58#endif /* _ASM_X86_SYS_IA32_H */ 55#endif /* _ASM_X86_SYS_IA32_H */
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 5f87b35fd2ef..2917a6452c49 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -37,8 +37,8 @@ asmlinkage long sys_get_thread_area(struct user_desc __user *);
37unsigned long sys_sigreturn(void); 37unsigned long sys_sigreturn(void);
38 38
39/* kernel/vm86_32.c */ 39/* kernel/vm86_32.c */
40int sys_vm86old(struct vm86_struct __user *); 40asmlinkage long sys_vm86old(struct vm86_struct __user *);
41int sys_vm86(unsigned long, unsigned long); 41asmlinkage long sys_vm86(unsigned long, unsigned long);
42 42
43#else /* CONFIG_X86_32 */ 43#else /* CONFIG_X86_32 */
44 44
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 1cf5766dde16..e8edcf52e069 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -33,6 +33,7 @@
33#include <linux/capability.h> 33#include <linux/capability.h>
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/syscalls.h>
36#include <linux/sched.h> 37#include <linux/sched.h>
37#include <linux/kernel.h> 38#include <linux/kernel.h>
38#include <linux/signal.h> 39#include <linux/signal.h>
@@ -48,7 +49,6 @@
48#include <asm/io.h> 49#include <asm/io.h>
49#include <asm/tlbflush.h> 50#include <asm/tlbflush.h>
50#include <asm/irq.h> 51#include <asm/irq.h>
51#include <asm/syscalls.h>
52 52
53/* 53/*
54 * Known problems: 54 * Known problems:
@@ -202,36 +202,32 @@ out:
202static int do_vm86_irq_handling(int subfunction, int irqnumber); 202static int do_vm86_irq_handling(int subfunction, int irqnumber);
203static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); 203static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk);
204 204
205int sys_vm86old(struct vm86_struct __user *v86) 205SYSCALL_DEFINE1(vm86old, struct vm86_struct __user *, v86)
206{ 206{
207 struct kernel_vm86_struct info; /* declare this _on top_, 207 struct kernel_vm86_struct info; /* declare this _on top_,
208 * this avoids wasting of stack space. 208 * this avoids wasting of stack space.
209 * This remains on the stack until we 209 * This remains on the stack until we
210 * return to 32 bit user space. 210 * return to 32 bit user space.
211 */ 211 */
212 struct task_struct *tsk; 212 struct task_struct *tsk = current;
213 int tmp, ret = -EPERM; 213 int tmp;
214 214
215 tsk = current;
216 if (tsk->thread.saved_sp0) 215 if (tsk->thread.saved_sp0)
217 goto out; 216 return -EPERM;
218 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 217 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
219 offsetof(struct kernel_vm86_struct, vm86plus) - 218 offsetof(struct kernel_vm86_struct, vm86plus) -
220 sizeof(info.regs)); 219 sizeof(info.regs));
221 ret = -EFAULT;
222 if (tmp) 220 if (tmp)
223 goto out; 221 return -EFAULT;
224 memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); 222 memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus);
225 info.regs32 = current_pt_regs(); 223 info.regs32 = current_pt_regs();
226 tsk->thread.vm86_info = v86; 224 tsk->thread.vm86_info = v86;
227 do_sys_vm86(&info, tsk); 225 do_sys_vm86(&info, tsk);
228 ret = 0; /* we never return here */ 226 return 0; /* we never return here */
229out:
230 return ret;
231} 227}
232 228
233 229
234int sys_vm86(unsigned long cmd, unsigned long arg) 230SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg)
235{ 231{
236 struct kernel_vm86_struct info; /* declare this _on top_, 232 struct kernel_vm86_struct info; /* declare this _on top_,
237 * this avoids wasting of stack space. 233 * this avoids wasting of stack space.
@@ -239,7 +235,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg)
239 * return to 32 bit user space. 235 * return to 32 bit user space.
240 */ 236 */
241 struct task_struct *tsk; 237 struct task_struct *tsk;
242 int tmp, ret; 238 int tmp;
243 struct vm86plus_struct __user *v86; 239 struct vm86plus_struct __user *v86;
244 240
245 tsk = current; 241 tsk = current;
@@ -248,8 +244,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg)
248 case VM86_FREE_IRQ: 244 case VM86_FREE_IRQ:
249 case VM86_GET_IRQ_BITS: 245 case VM86_GET_IRQ_BITS:
250 case VM86_GET_AND_RESET_IRQ: 246 case VM86_GET_AND_RESET_IRQ:
251 ret = do_vm86_irq_handling(cmd, (int)arg); 247 return do_vm86_irq_handling(cmd, (int)arg);
252 goto out;
253 case VM86_PLUS_INSTALL_CHECK: 248 case VM86_PLUS_INSTALL_CHECK:
254 /* 249 /*
255 * NOTE: on old vm86 stuff this will return the error 250 * NOTE: on old vm86 stuff this will return the error
@@ -257,28 +252,23 @@ int sys_vm86(unsigned long cmd, unsigned long arg)
257 * interpreted as (invalid) address to vm86_struct. 252 * interpreted as (invalid) address to vm86_struct.
258 * So the installation check works. 253 * So the installation check works.
259 */ 254 */
260 ret = 0; 255 return 0;
261 goto out;
262 } 256 }
263 257
264 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ 258 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */
265 ret = -EPERM;
266 if (tsk->thread.saved_sp0) 259 if (tsk->thread.saved_sp0)
267 goto out; 260 return -EPERM;
268 v86 = (struct vm86plus_struct __user *)arg; 261 v86 = (struct vm86plus_struct __user *)arg;
269 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 262 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
270 offsetof(struct kernel_vm86_struct, regs32) - 263 offsetof(struct kernel_vm86_struct, regs32) -
271 sizeof(info.regs)); 264 sizeof(info.regs));
272 ret = -EFAULT;
273 if (tmp) 265 if (tmp)
274 goto out; 266 return -EFAULT;
275 info.regs32 = current_pt_regs(); 267 info.regs32 = current_pt_regs();
276 info.vm86plus.is_vm86pus = 1; 268 info.vm86plus.is_vm86pus = 1;
277 tsk->thread.vm86_info = (struct vm86_struct __user *)v86; 269 tsk->thread.vm86_info = (struct vm86_struct __user *)v86;
278 do_sys_vm86(&info, tsk); 270 do_sys_vm86(&info, tsk);
279 ret = 0; /* we never return here */ 271 return 0; /* we never return here */
280out:
281 return ret;
282} 272}
283 273
284 274
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index d0d59bfbccce..aabfb8380a1c 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -345,7 +345,7 @@
345336 i386 perf_event_open sys_perf_event_open 345336 i386 perf_event_open sys_perf_event_open
346337 i386 recvmmsg sys_recvmmsg compat_sys_recvmmsg 346337 i386 recvmmsg sys_recvmmsg compat_sys_recvmmsg
347338 i386 fanotify_init sys_fanotify_init 347338 i386 fanotify_init sys_fanotify_init
348339 i386 fanotify_mark sys_fanotify_mark sys32_fanotify_mark 348339 i386 fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark
349340 i386 prlimit64 sys_prlimit64 349340 i386 prlimit64 sys_prlimit64
350341 i386 name_to_handle_at sys_name_to_handle_at 350341 i386 name_to_handle_at sys_name_to_handle_at
351342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at 351342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at