diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-25 19:14:55 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 18:16:27 -0500 |
commit | 5b3eb3ade4444c3b1419ffa23598a57f6f4bf494 (patch) | |
tree | 1f25f5eaf46fac683c502562347cb900ec946978 /arch | |
parent | 29fd448084e2da6d19ab675cf01d4a65fe2fcc44 (diff) |
x86: switch to generic old sigaction
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/ia32/sys_ia32.c | 39 | ||||
-rw-r--r-- | arch/x86/include/asm/ia32.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/signal.h | 9 | ||||
-rw-r--r-- | arch/x86/include/asm/sys_ia32.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/syscalls.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/signal.c | 47 | ||||
-rw-r--r-- | arch/x86/syscalls/syscall_32.tbl | 2 | ||||
-rw-r--r-- | arch/x86/um/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/um/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/um/syscalls_32.c | 38 |
11 files changed, 6 insertions, 148 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0271a1411af3..87d09175a0a9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -118,6 +118,8 @@ config X86 | |||
118 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | 118 | select GENERIC_COMPAT_RT_SIGQUEUEINFO |
119 | select GENERIC_COMPAT_RT_SIGPENDING | 119 | select GENERIC_COMPAT_RT_SIGPENDING |
120 | select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION | 120 | select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION |
121 | select OLD_SIGACTION if X86_32 | ||
122 | select COMPAT_OLD_SIGACTION if IA32_EMULATION | ||
121 | 123 | ||
122 | config INSTRUCTION_DECODER | 124 | config INSTRUCTION_DECODER |
123 | def_bool y | 125 | def_bool y |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index ffe9751b1486..592f5a9a9c0e 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -172,45 +172,6 @@ asmlinkage long sys32_mprotect(unsigned long start, size_t len, | |||
172 | return sys_mprotect(start, len, prot); | 172 | return sys_mprotect(start, len, prot); |
173 | } | 173 | } |
174 | 174 | ||
175 | asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act, | ||
176 | struct old_sigaction32 __user *oact) | ||
177 | { | ||
178 | struct k_sigaction new_ka, old_ka; | ||
179 | int ret; | ||
180 | |||
181 | if (act) { | ||
182 | compat_old_sigset_t mask; | ||
183 | compat_uptr_t handler, restorer; | ||
184 | |||
185 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
186 | __get_user(handler, &act->sa_handler) || | ||
187 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
188 | __get_user(restorer, &act->sa_restorer) || | ||
189 | __get_user(mask, &act->sa_mask)) | ||
190 | return -EFAULT; | ||
191 | |||
192 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
193 | new_ka.sa.sa_restorer = compat_ptr(restorer); | ||
194 | |||
195 | siginitset(&new_ka.sa.sa_mask, mask); | ||
196 | } | ||
197 | |||
198 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
199 | |||
200 | if (!ret && oact) { | ||
201 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
202 | __put_user(ptr_to_compat(old_ka.sa.sa_handler), | ||
203 | &oact->sa_handler) || | ||
204 | __put_user(ptr_to_compat(old_ka.sa.sa_restorer), | ||
205 | &oact->sa_restorer) || | ||
206 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
207 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
208 | return -EFAULT; | ||
209 | } | ||
210 | |||
211 | return ret; | ||
212 | } | ||
213 | |||
214 | asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int __user *stat_addr, | 175 | asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int __user *stat_addr, |
215 | int options) | 176 | int options) |
216 | { | 177 | { |
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h index 259372d1ee96..d0e8e0141041 100644 --- a/arch/x86/include/asm/ia32.h +++ b/arch/x86/include/asm/ia32.h | |||
@@ -13,13 +13,6 @@ | |||
13 | #include <asm/sigcontext32.h> | 13 | #include <asm/sigcontext32.h> |
14 | 14 | ||
15 | /* signal.h */ | 15 | /* signal.h */ |
16 | struct old_sigaction32 { | ||
17 | unsigned int sa_handler; /* Really a pointer, but need to deal | ||
18 | with 32 bits */ | ||
19 | compat_old_sigset_t sa_mask; /* A 32 bit mask */ | ||
20 | unsigned int sa_flags; | ||
21 | unsigned int sa_restorer; /* Another 32 bit pointer */ | ||
22 | }; | ||
23 | 16 | ||
24 | struct ucontext_ia32 { | 17 | struct ucontext_ia32 { |
25 | unsigned int uc_flags; | 18 | unsigned int uc_flags; |
diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h index 9bda8224f3d5..35e67a457182 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h | |||
@@ -34,15 +34,6 @@ extern void do_notify_resume(struct pt_regs *, void *, __u32); | |||
34 | 34 | ||
35 | #define __ARCH_HAS_SA_RESTORER | 35 | #define __ARCH_HAS_SA_RESTORER |
36 | 36 | ||
37 | #ifdef __i386__ | ||
38 | struct old_sigaction { | ||
39 | __sighandler_t sa_handler; | ||
40 | old_sigset_t sa_mask; | ||
41 | unsigned long sa_flags; | ||
42 | __sigrestore_t sa_restorer; | ||
43 | }; | ||
44 | |||
45 | #endif /* !__i386__ */ | ||
46 | #include <asm/sigcontext.h> | 37 | #include <asm/sigcontext.h> |
47 | 38 | ||
48 | #ifdef __i386__ | 39 | #ifdef __i386__ |
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h index 2bf18f1158bc..0218d917f509 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h | |||
@@ -32,9 +32,6 @@ struct mmap_arg_struct32; | |||
32 | asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *); | 32 | asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *); |
33 | asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long); | 33 | asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long); |
34 | 34 | ||
35 | struct old_sigaction32; | ||
36 | asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *, | ||
37 | struct old_sigaction32 __user *); | ||
38 | asmlinkage long sys32_alarm(unsigned int); | 35 | asmlinkage long sys32_alarm(unsigned int); |
39 | 36 | ||
40 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int); | 37 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int); |
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 7ed7dec7fb0e..6cf0a9cc60cd 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -34,8 +34,6 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *); | |||
34 | #ifdef CONFIG_X86_32 | 34 | #ifdef CONFIG_X86_32 |
35 | 35 | ||
36 | /* kernel/signal.c */ | 36 | /* kernel/signal.c */ |
37 | asmlinkage int sys_sigaction(int, const struct old_sigaction __user *, | ||
38 | struct old_sigaction __user *); | ||
39 | unsigned long sys_sigreturn(void); | 37 | unsigned long sys_sigreturn(void); |
40 | 38 | ||
41 | /* kernel/vm86_32.c */ | 39 | /* kernel/vm86_32.c */ |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 057712901509..d5b1f8a912ff 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -535,53 +535,6 @@ static int x32_setup_rt_frame(int sig, struct k_sigaction *ka, | |||
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
537 | 537 | ||
538 | #ifdef CONFIG_X86_32 | ||
539 | asmlinkage int | ||
540 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
541 | struct old_sigaction __user *oact) | ||
542 | { | ||
543 | struct k_sigaction new_ka, old_ka; | ||
544 | int ret = 0; | ||
545 | |||
546 | if (act) { | ||
547 | old_sigset_t mask; | ||
548 | |||
549 | if (!access_ok(VERIFY_READ, act, sizeof(*act))) | ||
550 | return -EFAULT; | ||
551 | |||
552 | get_user_try { | ||
553 | get_user_ex(new_ka.sa.sa_handler, &act->sa_handler); | ||
554 | get_user_ex(new_ka.sa.sa_flags, &act->sa_flags); | ||
555 | get_user_ex(mask, &act->sa_mask); | ||
556 | get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer); | ||
557 | } get_user_catch(ret); | ||
558 | |||
559 | if (ret) | ||
560 | return -EFAULT; | ||
561 | siginitset(&new_ka.sa.sa_mask, mask); | ||
562 | } | ||
563 | |||
564 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
565 | |||
566 | if (!ret && oact) { | ||
567 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) | ||
568 | return -EFAULT; | ||
569 | |||
570 | put_user_try { | ||
571 | put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler); | ||
572 | put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags); | ||
573 | put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
574 | put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer); | ||
575 | } put_user_catch(ret); | ||
576 | |||
577 | if (ret) | ||
578 | return -EFAULT; | ||
579 | } | ||
580 | |||
581 | return ret; | ||
582 | } | ||
583 | #endif /* CONFIG_X86_32 */ | ||
584 | |||
585 | /* | 538 | /* |
586 | * Do a signal return; undo the signal stack. | 539 | * Do a signal return; undo the signal stack. |
587 | */ | 540 | */ |
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index 2fada84c16ab..f2fe78ff22cc 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl | |||
@@ -73,7 +73,7 @@ | |||
73 | 64 i386 getppid sys_getppid | 73 | 64 i386 getppid sys_getppid |
74 | 65 i386 getpgrp sys_getpgrp | 74 | 65 i386 getpgrp sys_getpgrp |
75 | 66 i386 setsid sys_setsid | 75 | 66 i386 setsid sys_setsid |
76 | 67 i386 sigaction sys_sigaction sys32_sigaction | 76 | 67 i386 sigaction sys_sigaction compat_sys_sigaction |
77 | 68 i386 sgetmask sys_sgetmask | 77 | 68 i386 sgetmask sys_sgetmask |
78 | 69 i386 ssetmask sys_ssetmask | 78 | 69 i386 ssetmask sys_ssetmask |
79 | 70 i386 setreuid sys_setreuid16 | 79 | 70 i386 setreuid sys_setreuid16 |
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index a3725824449e..cf0f2731484e 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -26,6 +26,7 @@ config X86_32 | |||
26 | select MODULES_USE_ELF_REL | 26 | select MODULES_USE_ELF_REL |
27 | select CLONE_BACKWARDS | 27 | select CLONE_BACKWARDS |
28 | select OLD_SIGSUSPEND3 | 28 | select OLD_SIGSUSPEND3 |
29 | select OLD_SIGACTION | ||
29 | 30 | ||
30 | config X86_64 | 31 | config X86_64 |
31 | def_bool 64BIT | 32 | def_bool 64BIT |
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index 5d065b2222d3..eafa324eb7a5 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile | |||
@@ -10,7 +10,7 @@ endif | |||
10 | 10 | ||
11 | obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \ | 11 | obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \ |
12 | ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ | 12 | ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ |
13 | stub_$(BITS).o stub_segv.o syscalls_$(BITS).o \ | 13 | stub_$(BITS).o stub_segv.o \ |
14 | sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ | 14 | sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ |
15 | mem_$(BITS).o subarch.o os-$(OS)/ | 15 | mem_$(BITS).o subarch.o os-$(OS)/ |
16 | 16 | ||
@@ -25,7 +25,7 @@ subarch-$(CONFIG_HIGHMEM) += ../mm/highmem_32.o | |||
25 | 25 | ||
26 | else | 26 | else |
27 | 27 | ||
28 | obj-y += vdso/ | 28 | obj-y += syscalls_64.o vdso/ |
29 | 29 | ||
30 | subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../lib/thunk_64.o \ | 30 | subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../lib/thunk_64.o \ |
31 | ../lib/rwsem.o | 31 | ../lib/rwsem.o |
diff --git a/arch/x86/um/syscalls_32.c b/arch/x86/um/syscalls_32.c deleted file mode 100644 index e8bcea99acdb..000000000000 --- a/arch/x86/um/syscalls_32.c +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <linux/syscalls.h> | ||
7 | #include <sysdep/syscalls.h> | ||
8 | |||
9 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
10 | struct old_sigaction __user *oact) | ||
11 | { | ||
12 | struct k_sigaction new_ka, old_ka; | ||
13 | int ret; | ||
14 | |||
15 | if (act) { | ||
16 | old_sigset_t mask; | ||
17 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
18 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
19 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
20 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
21 | __get_user(mask, &act->sa_mask)) | ||
22 | return -EFAULT; | ||
23 | siginitset(&new_ka.sa.sa_mask, mask); | ||
24 | } | ||
25 | |||
26 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
27 | |||
28 | if (!ret && oact) { | ||
29 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
30 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
31 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
32 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
33 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
34 | return -EFAULT; | ||
35 | } | ||
36 | |||
37 | return ret; | ||
38 | } | ||