diff options
147 files changed, 486 insertions, 3806 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 8696c03a9d73..15740cf29bd4 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -24,6 +24,7 @@ config ALPHA | |||
24 | select MODULES_USE_ELF_RELA | 24 | select MODULES_USE_ELF_RELA |
25 | select GENERIC_SIGALTSTACK | 25 | select GENERIC_SIGALTSTACK |
26 | select ODD_RT_SIGACTION | 26 | select ODD_RT_SIGACTION |
27 | select OLD_SIGSUSPEND | ||
27 | help | 28 | help |
28 | The Alpha is a 64-bit general-purpose processor designed and | 29 | The Alpha is a 64-bit general-purpose processor designed and |
29 | marketed by the Digital Equipment Corporation of blessed memory, | 30 | marketed by the Digital Equipment Corporation of blessed memory, |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index b5d0d0923699..63d27fb9b023 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -250,7 +250,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp, | |||
250 | struct pt_regs *childregs = task_pt_regs(p); | 250 | struct pt_regs *childregs = task_pt_regs(p); |
251 | struct pt_regs *regs = current_pt_regs(); | 251 | struct pt_regs *regs = current_pt_regs(); |
252 | struct switch_stack *childstack, *stack; | 252 | struct switch_stack *childstack, *stack; |
253 | unsigned long settls; | ||
254 | 253 | ||
255 | childstack = ((struct switch_stack *) childregs) - 1; | 254 | childstack = ((struct switch_stack *) childregs) - 1; |
256 | childti->pcb.ksp = (unsigned long) childstack; | 255 | childti->pcb.ksp = (unsigned long) childstack; |
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 02d02c047f17..b5f385055244 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
@@ -113,16 +113,6 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act, | |||
113 | } | 113 | } |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Atomically swap in the new signal mask, and wait for a signal. | ||
117 | */ | ||
118 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) | ||
119 | { | ||
120 | sigset_t blocked; | ||
121 | siginitset(&blocked, mask); | ||
122 | return sigsuspend(&blocked); | ||
123 | } | ||
124 | |||
125 | /* | ||
126 | * Do a signal return; undo the signal stack. | 116 | * Do a signal return; undo the signal stack. |
127 | */ | 117 | */ |
128 | 118 | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 67874b82a4ed..db3152d6dd88 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -56,6 +56,9 @@ config ARM | |||
56 | select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND | 56 | select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND |
57 | select MODULES_USE_ELF_REL | 57 | select MODULES_USE_ELF_REL |
58 | select CLONE_BACKWARDS | 58 | select CLONE_BACKWARDS |
59 | select GENERIC_SIGALTSTACK | ||
60 | select OLD_SIGSUSPEND3 | ||
61 | select OLD_SIGACTION | ||
59 | help | 62 | help |
60 | The ARM series is a line of low-power-consumption RISC chip designs | 63 | The ARM series is a line of low-power-consumption RISC chip designs |
61 | licensed by ARM Ltd and targeted at embedded applications and | 64 | licensed by ARM Ltd and targeted at embedded applications and |
diff --git a/arch/arm/include/asm/signal.h b/arch/arm/include/asm/signal.h index a5076b9bd463..c0eb412aff04 100644 --- a/arch/arm/include/asm/signal.h +++ b/arch/arm/include/asm/signal.h | |||
@@ -16,13 +16,6 @@ typedef struct { | |||
16 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
17 | } sigset_t; | 17 | } sigset_t; |
18 | 18 | ||
19 | struct old_sigaction { | ||
20 | __sighandler_t sa_handler; | ||
21 | old_sigset_t sa_mask; | ||
22 | unsigned long sa_flags; | ||
23 | __sigrestore_t sa_restorer; | ||
24 | }; | ||
25 | |||
26 | #define __ARCH_HAS_SA_RESTORER | 19 | #define __ARCH_HAS_SA_RESTORER |
27 | 20 | ||
28 | #include <asm/sigcontext.h> | 21 | #include <asm/sigcontext.h> |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index a4fda4e7a372..0cc57611fc4f 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -195,7 +195,7 @@ | |||
195 | CALL(sys_getcwd) | 195 | CALL(sys_getcwd) |
196 | CALL(sys_capget) | 196 | CALL(sys_capget) |
197 | /* 185 */ CALL(sys_capset) | 197 | /* 185 */ CALL(sys_capset) |
198 | CALL(sys_sigaltstack_wrapper) | 198 | CALL(sys_sigaltstack) |
199 | CALL(sys_sendfile) | 199 | CALL(sys_sendfile) |
200 | CALL(sys_ni_syscall) /* getpmsg */ | 200 | CALL(sys_ni_syscall) /* getpmsg */ |
201 | CALL(sys_ni_syscall) /* putpmsg */ | 201 | CALL(sys_ni_syscall) /* putpmsg */ |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index a6c301e90a3b..3248cde504ed 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -514,11 +514,6 @@ sys_rt_sigreturn_wrapper: | |||
514 | b sys_rt_sigreturn | 514 | b sys_rt_sigreturn |
515 | ENDPROC(sys_rt_sigreturn_wrapper) | 515 | ENDPROC(sys_rt_sigreturn_wrapper) |
516 | 516 | ||
517 | sys_sigaltstack_wrapper: | ||
518 | ldr r2, [sp, #S_OFF + S_SP] | ||
519 | b do_sigaltstack | ||
520 | ENDPROC(sys_sigaltstack_wrapper) | ||
521 | |||
522 | sys_statfs64_wrapper: | 517 | sys_statfs64_wrapper: |
523 | teq r1, #88 | 518 | teq r1, #88 |
524 | moveq r1, #84 | 519 | moveq r1, #84 |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 56f72d257ebd..07429a23c720 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -45,48 +45,6 @@ const unsigned long sigreturn_codes[7] = { | |||
45 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, | 45 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* | ||
49 | * atomically swap in the new signal mask, and wait for a signal. | ||
50 | */ | ||
51 | asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask) | ||
52 | { | ||
53 | sigset_t blocked; | ||
54 | siginitset(&blocked, mask); | ||
55 | return sigsuspend(&blocked); | ||
56 | } | ||
57 | |||
58 | asmlinkage int | ||
59 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
60 | struct old_sigaction __user *oact) | ||
61 | { | ||
62 | struct k_sigaction new_ka, old_ka; | ||
63 | int ret; | ||
64 | |||
65 | if (act) { | ||
66 | old_sigset_t mask; | ||
67 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
68 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
69 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
70 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
71 | __get_user(mask, &act->sa_mask)) | ||
72 | return -EFAULT; | ||
73 | siginitset(&new_ka.sa.sa_mask, mask); | ||
74 | } | ||
75 | |||
76 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
77 | |||
78 | if (!ret && oact) { | ||
79 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
80 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
81 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
82 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
83 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
84 | return -EFAULT; | ||
85 | } | ||
86 | |||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | #ifdef CONFIG_CRUNCH | 48 | #ifdef CONFIG_CRUNCH |
91 | static int preserve_crunch_context(struct crunch_sigframe __user *frame) | 49 | static int preserve_crunch_context(struct crunch_sigframe __user *frame) |
92 | { | 50 | { |
@@ -300,7 +258,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
300 | if (restore_sigframe(regs, &frame->sig)) | 258 | if (restore_sigframe(regs, &frame->sig)) |
301 | goto badframe; | 259 | goto badframe; |
302 | 260 | ||
303 | if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) | 261 | if (restore_altstack(&frame->sig.uc.uc_stack)) |
304 | goto badframe; | 262 | goto badframe; |
305 | 263 | ||
306 | return regs->ARM_r0; | 264 | return regs->ARM_r0; |
@@ -486,7 +444,6 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
486 | sigset_t *set, struct pt_regs *regs) | 444 | sigset_t *set, struct pt_regs *regs) |
487 | { | 445 | { |
488 | struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame)); | 446 | struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame)); |
489 | stack_t stack; | ||
490 | int err = 0; | 447 | int err = 0; |
491 | 448 | ||
492 | if (!frame) | 449 | if (!frame) |
@@ -497,12 +454,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
497 | __put_user_error(0, &frame->sig.uc.uc_flags, err); | 454 | __put_user_error(0, &frame->sig.uc.uc_flags, err); |
498 | __put_user_error(NULL, &frame->sig.uc.uc_link, err); | 455 | __put_user_error(NULL, &frame->sig.uc.uc_link, err); |
499 | 456 | ||
500 | memset(&stack, 0, sizeof(stack)); | 457 | err |= __save_altstack(&frame->sig.uc.uc_stack, regs->ARM_sp); |
501 | stack.ss_sp = (void __user *)current->sas_ss_sp; | ||
502 | stack.ss_flags = sas_ss_flags(regs->ARM_sp); | ||
503 | stack.ss_size = current->sas_ss_size; | ||
504 | err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack)); | ||
505 | |||
506 | err |= setup_sigframe(&frame->sig, regs, set); | 458 | err |= setup_sigframe(&frame->sig, regs, set); |
507 | if (err == 0) | 459 | if (err == 0) |
508 | err = setup_return(regs, ka, frame->sig.retcode, frame, usig); | 460 | err = setup_return(regs, ka, frame->sig.retcode, frame, usig); |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index f8f362aafee9..1f27c58f44ad 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -6,10 +6,15 @@ config ARM64 | |||
6 | select CLONE_BACKWARDS | 6 | select CLONE_BACKWARDS |
7 | select COMMON_CLK | 7 | select COMMON_CLK |
8 | select GENERIC_CLOCKEVENTS | 8 | select GENERIC_CLOCKEVENTS |
9 | select GENERIC_COMPAT_RT_SIGACTION | ||
10 | select GENERIC_COMPAT_RT_SIGPENDING | ||
11 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
12 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
9 | select GENERIC_HARDIRQS_NO_DEPRECATED | 13 | select GENERIC_HARDIRQS_NO_DEPRECATED |
10 | select GENERIC_IOMAP | 14 | select GENERIC_IOMAP |
11 | select GENERIC_IRQ_PROBE | 15 | select GENERIC_IRQ_PROBE |
12 | select GENERIC_IRQ_SHOW | 16 | select GENERIC_IRQ_SHOW |
17 | select GENERIC_SIGALTSTACK | ||
13 | select GENERIC_SMP_IDLE_THREAD | 18 | select GENERIC_SMP_IDLE_THREAD |
14 | select GENERIC_TIME_VSYSCALL | 19 | select GENERIC_TIME_VSYSCALL |
15 | select HARDIRQS_SW_RESEND | 20 | select HARDIRQS_SW_RESEND |
@@ -204,6 +209,8 @@ config COMPAT | |||
204 | depends on !ARM64_64K_PAGES | 209 | depends on !ARM64_64K_PAGES |
205 | select COMPAT_BINFMT_ELF | 210 | select COMPAT_BINFMT_ELF |
206 | select HAVE_UID16 | 211 | select HAVE_UID16 |
212 | select OLD_SIGSUSPEND3 | ||
213 | select COMPAT_OLD_SIGACTION | ||
207 | help | 214 | help |
208 | This option enables support for a 32-bit EL0 running under a 64-bit | 215 | This option enables support for a 32-bit EL0 running under a 64-bit |
209 | kernel at EL1. AArch32-specific components such as system calls, | 216 | kernel at EL1. AArch32-specific components such as system calls, |
diff --git a/arch/arm64/include/asm/syscalls.h b/arch/arm64/include/asm/syscalls.h index 20d63b290665..48fe7c600e98 100644 --- a/arch/arm64/include/asm/syscalls.h +++ b/arch/arm64/include/asm/syscalls.h | |||
@@ -24,8 +24,6 @@ | |||
24 | * System call wrappers implemented in kernel/entry.S. | 24 | * System call wrappers implemented in kernel/entry.S. |
25 | */ | 25 | */ |
26 | asmlinkage long sys_rt_sigreturn_wrapper(void); | 26 | asmlinkage long sys_rt_sigreturn_wrapper(void); |
27 | asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss, | ||
28 | stack_t __user *uoss); | ||
29 | 27 | ||
30 | #include <asm-generic/syscalls.h> | 28 | #include <asm-generic/syscalls.h> |
31 | 29 | ||
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 5ef47ba3ed45..e60e386178d1 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
@@ -93,7 +93,7 @@ __SYSCALL(68, sys_ni_syscall) /* 68 was sys_sgetmask */ | |||
93 | __SYSCALL(69, sys_ni_syscall) /* 69 was sys_ssetmask */ | 93 | __SYSCALL(69, sys_ni_syscall) /* 69 was sys_ssetmask */ |
94 | __SYSCALL(70, sys_setreuid16) | 94 | __SYSCALL(70, sys_setreuid16) |
95 | __SYSCALL(71, sys_setregid16) | 95 | __SYSCALL(71, sys_setregid16) |
96 | __SYSCALL(72, compat_sys_sigsuspend) | 96 | __SYSCALL(72, sys_sigsuspend) |
97 | __SYSCALL(73, compat_sys_sigpending) | 97 | __SYSCALL(73, compat_sys_sigpending) |
98 | __SYSCALL(74, sys_sethostname) | 98 | __SYSCALL(74, sys_sethostname) |
99 | __SYSCALL(75, compat_sys_setrlimit) | 99 | __SYSCALL(75, compat_sys_setrlimit) |
@@ -207,7 +207,7 @@ __SYSCALL(182, sys_chown16) | |||
207 | __SYSCALL(183, sys_getcwd) | 207 | __SYSCALL(183, sys_getcwd) |
208 | __SYSCALL(184, sys_capget) | 208 | __SYSCALL(184, sys_capget) |
209 | __SYSCALL(185, sys_capset) | 209 | __SYSCALL(185, sys_capset) |
210 | __SYSCALL(186, compat_sys_sigaltstack_wrapper) | 210 | __SYSCALL(186, compat_sys_sigaltstack) |
211 | __SYSCALL(187, compat_sys_sendfile) | 211 | __SYSCALL(187, compat_sys_sendfile) |
212 | __SYSCALL(188, sys_ni_syscall) /* 188 reserved */ | 212 | __SYSCALL(188, sys_ni_syscall) /* 188 reserved */ |
213 | __SYSCALL(189, sys_ni_syscall) /* 189 reserved */ | 213 | __SYSCALL(189, sys_ni_syscall) /* 189 reserved */ |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 9c94f404ded6..514d6098dbee 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -677,10 +677,5 @@ ENTRY(sys_rt_sigreturn_wrapper) | |||
677 | b sys_rt_sigreturn | 677 | b sys_rt_sigreturn |
678 | ENDPROC(sys_rt_sigreturn_wrapper) | 678 | ENDPROC(sys_rt_sigreturn_wrapper) |
679 | 679 | ||
680 | ENTRY(sys_sigaltstack_wrapper) | ||
681 | ldr x2, [sp, #S_SP] | ||
682 | b sys_sigaltstack | ||
683 | ENDPROC(sys_sigaltstack_wrapper) | ||
684 | |||
685 | ENTRY(handle_arch_irq) | 680 | ENTRY(handle_arch_irq) |
686 | .quad 0 | 681 | .quad 0 |
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index abd756315cb5..890a591f75dd 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c | |||
@@ -149,8 +149,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) | |||
149 | if (restore_sigframe(regs, frame)) | 149 | if (restore_sigframe(regs, frame)) |
150 | goto badframe; | 150 | goto badframe; |
151 | 151 | ||
152 | if (do_sigaltstack(&frame->uc.uc_stack, | 152 | if (restore_altstack(&frame->uc.uc_stack)) |
153 | NULL, regs->sp) == -EFAULT) | ||
154 | goto badframe; | 153 | goto badframe; |
155 | 154 | ||
156 | return regs->regs[0]; | 155 | return regs->regs[0]; |
@@ -164,12 +163,6 @@ badframe: | |||
164 | return 0; | 163 | return 0; |
165 | } | 164 | } |
166 | 165 | ||
167 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
168 | unsigned long sp) | ||
169 | { | ||
170 | return do_sigaltstack(uss, uoss, sp); | ||
171 | } | ||
172 | |||
173 | static int setup_sigframe(struct rt_sigframe __user *sf, | 166 | static int setup_sigframe(struct rt_sigframe __user *sf, |
174 | struct pt_regs *regs, sigset_t *set) | 167 | struct pt_regs *regs, sigset_t *set) |
175 | { | 168 | { |
@@ -250,7 +243,6 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
250 | sigset_t *set, struct pt_regs *regs) | 243 | sigset_t *set, struct pt_regs *regs) |
251 | { | 244 | { |
252 | struct rt_sigframe __user *frame; | 245 | struct rt_sigframe __user *frame; |
253 | stack_t stack; | ||
254 | int err = 0; | 246 | int err = 0; |
255 | 247 | ||
256 | frame = get_sigframe(ka, regs); | 248 | frame = get_sigframe(ka, regs); |
@@ -260,12 +252,7 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
260 | __put_user_error(0, &frame->uc.uc_flags, err); | 252 | __put_user_error(0, &frame->uc.uc_flags, err); |
261 | __put_user_error(NULL, &frame->uc.uc_link, err); | 253 | __put_user_error(NULL, &frame->uc.uc_link, err); |
262 | 254 | ||
263 | memset(&stack, 0, sizeof(stack)); | 255 | err |= __save_altstack(&frame->uc.uc_stack, regs->sp); |
264 | stack.ss_sp = (void __user *)current->sas_ss_sp; | ||
265 | stack.ss_flags = sas_ss_flags(regs->sp); | ||
266 | stack.ss_size = current->sas_ss_size; | ||
267 | err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack)); | ||
268 | |||
269 | err |= setup_sigframe(frame, regs, set); | 256 | err |= setup_sigframe(frame, regs, set); |
270 | if (err == 0) { | 257 | if (err == 0) { |
271 | setup_return(regs, ka, frame, usig); | 258 | setup_return(regs, ka, frame, usig); |
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index a4db3d22aac4..92ada01f4cd8 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c | |||
@@ -28,26 +28,6 @@ | |||
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | #include <asm/unistd32.h> | 29 | #include <asm/unistd32.h> |
30 | 30 | ||
31 | struct compat_sigaction { | ||
32 | compat_uptr_t sa_handler; | ||
33 | compat_ulong_t sa_flags; | ||
34 | compat_uptr_t sa_restorer; | ||
35 | compat_sigset_t sa_mask; | ||
36 | }; | ||
37 | |||
38 | struct compat_old_sigaction { | ||
39 | compat_uptr_t sa_handler; | ||
40 | compat_old_sigset_t sa_mask; | ||
41 | compat_ulong_t sa_flags; | ||
42 | compat_uptr_t sa_restorer; | ||
43 | }; | ||
44 | |||
45 | typedef struct compat_sigaltstack { | ||
46 | compat_uptr_t ss_sp; | ||
47 | int ss_flags; | ||
48 | compat_size_t ss_size; | ||
49 | } compat_stack_t; | ||
50 | |||
51 | struct compat_sigcontext { | 31 | struct compat_sigcontext { |
52 | /* We always set these two fields to 0 */ | 32 | /* We always set these two fields to 0 */ |
53 | compat_ulong_t trap_no; | 33 | compat_ulong_t trap_no; |
@@ -339,127 +319,6 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame) | |||
339 | return err ? -EFAULT : 0; | 319 | return err ? -EFAULT : 0; |
340 | } | 320 | } |
341 | 321 | ||
342 | /* | ||
343 | * atomically swap in the new signal mask, and wait for a signal. | ||
344 | */ | ||
345 | asmlinkage int compat_sys_sigsuspend(int restart, compat_ulong_t oldmask, | ||
346 | compat_old_sigset_t mask) | ||
347 | { | ||
348 | sigset_t blocked; | ||
349 | |||
350 | siginitset(¤t->blocked, mask); | ||
351 | return sigsuspend(&blocked); | ||
352 | } | ||
353 | |||
354 | asmlinkage int compat_sys_sigaction(int sig, | ||
355 | const struct compat_old_sigaction __user *act, | ||
356 | struct compat_old_sigaction __user *oact) | ||
357 | { | ||
358 | struct k_sigaction new_ka, old_ka; | ||
359 | int ret; | ||
360 | compat_old_sigset_t mask; | ||
361 | compat_uptr_t handler, restorer; | ||
362 | |||
363 | if (act) { | ||
364 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
365 | __get_user(handler, &act->sa_handler) || | ||
366 | __get_user(restorer, &act->sa_restorer) || | ||
367 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
368 | __get_user(mask, &act->sa_mask)) | ||
369 | return -EFAULT; | ||
370 | |||
371 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
372 | new_ka.sa.sa_restorer = compat_ptr(restorer); | ||
373 | siginitset(&new_ka.sa.sa_mask, mask); | ||
374 | } | ||
375 | |||
376 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
377 | |||
378 | if (!ret && oact) { | ||
379 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
380 | __put_user(ptr_to_compat(old_ka.sa.sa_handler), | ||
381 | &oact->sa_handler) || | ||
382 | __put_user(ptr_to_compat(old_ka.sa.sa_restorer), | ||
383 | &oact->sa_restorer) || | ||
384 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
385 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
386 | return -EFAULT; | ||
387 | } | ||
388 | |||
389 | return ret; | ||
390 | } | ||
391 | |||
392 | asmlinkage int compat_sys_rt_sigaction(int sig, | ||
393 | const struct compat_sigaction __user *act, | ||
394 | struct compat_sigaction __user *oact, | ||
395 | compat_size_t sigsetsize) | ||
396 | { | ||
397 | struct k_sigaction new_ka, old_ka; | ||
398 | int ret; | ||
399 | |||
400 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
401 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
402 | return -EINVAL; | ||
403 | |||
404 | if (act) { | ||
405 | compat_uptr_t handler, restorer; | ||
406 | |||
407 | ret = get_user(handler, &act->sa_handler); | ||
408 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
409 | ret |= get_user(restorer, &act->sa_restorer); | ||
410 | new_ka.sa.sa_restorer = compat_ptr(restorer); | ||
411 | ret |= get_sigset_t(&new_ka.sa.sa_mask, &act->sa_mask); | ||
412 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
413 | if (ret) | ||
414 | return -EFAULT; | ||
415 | } | ||
416 | |||
417 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
418 | if (!ret && oact) { | ||
419 | ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); | ||
420 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); | ||
421 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
422 | } | ||
423 | return ret; | ||
424 | } | ||
425 | |||
426 | int compat_do_sigaltstack(compat_uptr_t compat_uss, compat_uptr_t compat_uoss, | ||
427 | compat_ulong_t sp) | ||
428 | { | ||
429 | compat_stack_t __user *newstack = compat_ptr(compat_uss); | ||
430 | compat_stack_t __user *oldstack = compat_ptr(compat_uoss); | ||
431 | compat_uptr_t ss_sp; | ||
432 | int ret; | ||
433 | mm_segment_t old_fs; | ||
434 | stack_t uss, uoss; | ||
435 | |||
436 | /* Marshall the compat new stack into a stack_t */ | ||
437 | if (newstack) { | ||
438 | if (get_user(ss_sp, &newstack->ss_sp) || | ||
439 | __get_user(uss.ss_flags, &newstack->ss_flags) || | ||
440 | __get_user(uss.ss_size, &newstack->ss_size)) | ||
441 | return -EFAULT; | ||
442 | uss.ss_sp = compat_ptr(ss_sp); | ||
443 | } | ||
444 | |||
445 | old_fs = get_fs(); | ||
446 | set_fs(KERNEL_DS); | ||
447 | /* The __user pointer casts are valid because of the set_fs() */ | ||
448 | ret = do_sigaltstack( | ||
449 | newstack ? (stack_t __user *) &uss : NULL, | ||
450 | oldstack ? (stack_t __user *) &uoss : NULL, | ||
451 | (unsigned long)sp); | ||
452 | set_fs(old_fs); | ||
453 | |||
454 | /* Convert the old stack_t into a compat stack. */ | ||
455 | if (!ret && oldstack && | ||
456 | (put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) || | ||
457 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || | ||
458 | __put_user(uoss.ss_size, &oldstack->ss_size))) | ||
459 | return -EFAULT; | ||
460 | return ret; | ||
461 | } | ||
462 | |||
463 | static int compat_restore_sigframe(struct pt_regs *regs, | 322 | static int compat_restore_sigframe(struct pt_regs *regs, |
464 | struct compat_sigframe __user *sf) | 323 | struct compat_sigframe __user *sf) |
465 | { | 324 | { |
@@ -562,9 +421,7 @@ asmlinkage int compat_sys_rt_sigreturn(struct pt_regs *regs) | |||
562 | if (compat_restore_sigframe(regs, &frame->sig)) | 421 | if (compat_restore_sigframe(regs, &frame->sig)) |
563 | goto badframe; | 422 | goto badframe; |
564 | 423 | ||
565 | if (compat_do_sigaltstack(ptr_to_compat(&frame->sig.uc.uc_stack), | 424 | if (compat_restore_altstack(&frame->sig.uc.uc_stack)) |
566 | ptr_to_compat((void __user *)NULL), | ||
567 | regs->compat_sp) == -EFAULT) | ||
568 | goto badframe; | 425 | goto badframe; |
569 | 426 | ||
570 | return regs->regs[0]; | 427 | return regs->regs[0]; |
@@ -705,11 +562,7 @@ int compat_setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
705 | __put_user_error(0, &frame->sig.uc.uc_flags, err); | 562 | __put_user_error(0, &frame->sig.uc.uc_flags, err); |
706 | __put_user_error(NULL, &frame->sig.uc.uc_link, err); | 563 | __put_user_error(NULL, &frame->sig.uc.uc_link, err); |
707 | 564 | ||
708 | memset(&stack, 0, sizeof(stack)); | 565 | err |= __compat_save_altstack(&frame->sig.uc.uc_stack, regs->compat_sp); |
709 | stack.ss_sp = (compat_uptr_t)current->sas_ss_sp; | ||
710 | stack.ss_flags = sas_ss_flags(regs->compat_sp); | ||
711 | stack.ss_size = current->sas_ss_size; | ||
712 | err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack)); | ||
713 | 566 | ||
714 | err |= compat_setup_sigframe(&frame->sig, regs, set); | 567 | err |= compat_setup_sigframe(&frame->sig, regs, set); |
715 | 568 | ||
@@ -742,75 +595,6 @@ int compat_setup_frame(int usig, struct k_sigaction *ka, sigset_t *set, | |||
742 | return err; | 595 | return err; |
743 | } | 596 | } |
744 | 597 | ||
745 | /* | ||
746 | * RT signals don't have generic compat wrappers. | ||
747 | * See arch/powerpc/kernel/signal_32.c | ||
748 | */ | ||
749 | asmlinkage int compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set, | ||
750 | compat_sigset_t __user *oset, | ||
751 | compat_size_t sigsetsize) | ||
752 | { | ||
753 | sigset_t s; | ||
754 | sigset_t __user *up; | ||
755 | int ret; | ||
756 | mm_segment_t old_fs = get_fs(); | ||
757 | |||
758 | if (set) { | ||
759 | if (get_sigset_t(&s, set)) | ||
760 | return -EFAULT; | ||
761 | } | ||
762 | |||
763 | set_fs(KERNEL_DS); | ||
764 | /* This is valid because of the set_fs() */ | ||
765 | up = (sigset_t __user *) &s; | ||
766 | ret = sys_rt_sigprocmask(how, set ? up : NULL, oset ? up : NULL, | ||
767 | sigsetsize); | ||
768 | set_fs(old_fs); | ||
769 | if (ret) | ||
770 | return ret; | ||
771 | if (oset) { | ||
772 | if (put_sigset_t(oset, &s)) | ||
773 | return -EFAULT; | ||
774 | } | ||
775 | return 0; | ||
776 | } | ||
777 | |||
778 | asmlinkage int compat_sys_rt_sigpending(compat_sigset_t __user *set, | ||
779 | compat_size_t sigsetsize) | ||
780 | { | ||
781 | sigset_t s; | ||
782 | int ret; | ||
783 | mm_segment_t old_fs = get_fs(); | ||
784 | |||
785 | set_fs(KERNEL_DS); | ||
786 | /* The __user pointer cast is valid because of the set_fs() */ | ||
787 | ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); | ||
788 | set_fs(old_fs); | ||
789 | if (!ret) { | ||
790 | if (put_sigset_t(set, &s)) | ||
791 | return -EFAULT; | ||
792 | } | ||
793 | return ret; | ||
794 | } | ||
795 | |||
796 | asmlinkage int compat_sys_rt_sigqueueinfo(int pid, int sig, | ||
797 | compat_siginfo_t __user *uinfo) | ||
798 | { | ||
799 | siginfo_t info; | ||
800 | int ret; | ||
801 | mm_segment_t old_fs = get_fs(); | ||
802 | |||
803 | ret = copy_siginfo_from_user32(&info, uinfo); | ||
804 | if (unlikely(ret)) | ||
805 | return ret; | ||
806 | |||
807 | set_fs (KERNEL_DS); | ||
808 | /* The __user pointer cast is valid because of the set_fs() */ | ||
809 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info); | ||
810 | set_fs (old_fs); | ||
811 | return ret; | ||
812 | } | ||
813 | |||
814 | void compat_setup_restart_syscall(struct pt_regs *regs) | 598 | void compat_setup_restart_syscall(struct pt_regs *regs) |
815 | { | 599 | { |
816 | regs->regs[7] = __NR_compat_restart_syscall; | 600 | regs->regs[7] = __NR_compat_restart_syscall; |
diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c index 8292a9b090f8..3fa98ff14f0e 100644 --- a/arch/arm64/kernel/sys.c +++ b/arch/arm64/kernel/sys.c | |||
@@ -40,7 +40,6 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | |||
40 | * Wrappers to pass the pt_regs argument. | 40 | * Wrappers to pass the pt_regs argument. |
41 | */ | 41 | */ |
42 | #define sys_rt_sigreturn sys_rt_sigreturn_wrapper | 42 | #define sys_rt_sigreturn sys_rt_sigreturn_wrapper |
43 | #define sys_sigaltstack sys_sigaltstack_wrapper | ||
44 | 43 | ||
45 | #include <asm/syscalls.h> | 44 | #include <asm/syscalls.h> |
46 | 45 | ||
diff --git a/arch/arm64/kernel/sys32.S b/arch/arm64/kernel/sys32.S index 7ef59e9245ef..6abb05721614 100644 --- a/arch/arm64/kernel/sys32.S +++ b/arch/arm64/kernel/sys32.S | |||
@@ -39,11 +39,6 @@ compat_sys_rt_sigreturn_wrapper: | |||
39 | b compat_sys_rt_sigreturn | 39 | b compat_sys_rt_sigreturn |
40 | ENDPROC(compat_sys_rt_sigreturn_wrapper) | 40 | ENDPROC(compat_sys_rt_sigreturn_wrapper) |
41 | 41 | ||
42 | compat_sys_sigaltstack_wrapper: | ||
43 | ldr x2, [sp, #S_COMPAT_SP] | ||
44 | b compat_do_sigaltstack | ||
45 | ENDPROC(compat_sys_sigaltstack_wrapper) | ||
46 | |||
47 | compat_sys_statfs64_wrapper: | 42 | compat_sys_statfs64_wrapper: |
48 | mov w3, #84 | 43 | mov w3, #84 |
49 | cmp w1, #88 | 44 | cmp w1, #88 |
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 2ae6591b3a55..e888b72b6e10 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig | |||
@@ -17,6 +17,7 @@ config AVR32 | |||
17 | select GENERIC_CLOCKEVENTS | 17 | select GENERIC_CLOCKEVENTS |
18 | select HAVE_MOD_ARCH_SPECIFIC | 18 | select HAVE_MOD_ARCH_SPECIFIC |
19 | select MODULES_USE_ELF_RELA | 19 | select MODULES_USE_ELF_RELA |
20 | select GENERIC_SIGALTSTACK | ||
20 | help | 21 | help |
21 | AVR32 is a high-performance 32-bit RISC microprocessor core, | 22 | AVR32 is a high-performance 32-bit RISC microprocessor core, |
22 | designed for cost-sensitive embedded applications, with particular | 23 | designed for cost-sensitive embedded applications, with particular |
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c index 5e01c3a40ced..b80c0b3d2bab 100644 --- a/arch/avr32/kernel/signal.c +++ b/arch/avr32/kernel/signal.c | |||
@@ -21,12 +21,6 @@ | |||
21 | #include <asm/ucontext.h> | 21 | #include <asm/ucontext.h> |
22 | #include <asm/syscalls.h> | 22 | #include <asm/syscalls.h> |
23 | 23 | ||
24 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
25 | struct pt_regs *regs) | ||
26 | { | ||
27 | return do_sigaltstack(uss, uoss, regs->sp); | ||
28 | } | ||
29 | |||
30 | struct rt_sigframe | 24 | struct rt_sigframe |
31 | { | 25 | { |
32 | struct siginfo info; | 26 | struct siginfo info; |
@@ -91,7 +85,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
91 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 85 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
92 | goto badframe; | 86 | goto badframe; |
93 | 87 | ||
94 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) | 88 | if (restore_altstack(&frame->uc.uc_stack)) |
95 | goto badframe; | 89 | goto badframe; |
96 | 90 | ||
97 | pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n", | 91 | pr_debug("Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n", |
@@ -175,12 +169,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
175 | /* Set up the ucontext */ | 169 | /* Set up the ucontext */ |
176 | err |= __put_user(0, &frame->uc.uc_flags); | 170 | err |= __put_user(0, &frame->uc.uc_flags); |
177 | err |= __put_user(NULL, &frame->uc.uc_link); | 171 | err |= __put_user(NULL, &frame->uc.uc_link); |
178 | err |= __put_user((void __user *)current->sas_ss_sp, | 172 | err |= __save_altstack(&frame->uc.uc_stack, regs->sp); |
179 | &frame->uc.uc_stack.ss_sp); | ||
180 | err |= __put_user(sas_ss_flags(regs->sp), | ||
181 | &frame->uc.uc_stack.ss_flags); | ||
182 | err |= __put_user(current->sas_ss_size, | ||
183 | &frame->uc.uc_stack.ss_size); | ||
184 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs); | 173 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs); |
185 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 174 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
186 | 175 | ||
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S index 275aab9731fd..b5fc927cd398 100644 --- a/arch/avr32/kernel/syscall-stubs.S +++ b/arch/avr32/kernel/syscall-stubs.S | |||
@@ -20,12 +20,6 @@ __sys_rt_sigsuspend: | |||
20 | mov r10, sp | 20 | mov r10, sp |
21 | rjmp sys_rt_sigsuspend | 21 | rjmp sys_rt_sigsuspend |
22 | 22 | ||
23 | .global __sys_sigaltstack | ||
24 | .type __sys_sigaltstack,@function | ||
25 | __sys_sigaltstack: | ||
26 | mov r10, sp | ||
27 | rjmp sys_sigaltstack | ||
28 | |||
29 | .global __sys_rt_sigreturn | 23 | .global __sys_rt_sigreturn |
30 | .type __sys_rt_sigreturn,@function | 24 | .type __sys_rt_sigreturn,@function |
31 | __sys_rt_sigreturn: | 25 | __sys_rt_sigreturn: |
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index f27bb878da6b..017a904180c8 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S | |||
@@ -115,7 +115,7 @@ sys_call_table: | |||
115 | .long sys_statfs | 115 | .long sys_statfs |
116 | .long sys_fstatfs /* 100 */ | 116 | .long sys_fstatfs /* 100 */ |
117 | .long sys_vhangup | 117 | .long sys_vhangup |
118 | .long __sys_sigaltstack | 118 | .long sys_sigaltstack |
119 | .long sys_syslog | 119 | .long sys_syslog |
120 | .long sys_setitimer | 120 | .long sys_setitimer |
121 | .long sys_getitimer /* 105 */ | 121 | .long sys_getitimer /* 105 */ |
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index b6f3ad5441c5..a8a9ca7d40f3 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -45,6 +45,7 @@ config BLACKFIN | |||
45 | select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS | 45 | select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS |
46 | select HAVE_MOD_ARCH_SPECIFIC | 46 | select HAVE_MOD_ARCH_SPECIFIC |
47 | select MODULES_USE_ELF_RELA | 47 | select MODULES_USE_ELF_RELA |
48 | select GENERIC_SIGALTSTACK | ||
48 | 49 | ||
49 | config GENERIC_CSUM | 50 | config GENERIC_CSUM |
50 | def_bool y | 51 | def_bool y |
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 84b4be05840c..b022af6c48f8 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c | |||
@@ -37,11 +37,6 @@ struct rt_sigframe { | |||
37 | struct ucontext uc; | 37 | struct ucontext uc; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
41 | { | ||
42 | return do_sigaltstack(uss, uoss, rdusp()); | ||
43 | } | ||
44 | |||
45 | static inline int | 40 | static inline int |
46 | rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0) | 41 | rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0) |
47 | { | 42 | { |
@@ -100,7 +95,7 @@ asmlinkage int sys_rt_sigreturn(void) | |||
100 | if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 95 | if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
101 | goto badframe; | 96 | goto badframe; |
102 | 97 | ||
103 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->usp) == -EFAULT) | 98 | if (restore_altstack(&frame->uc.uc_stack)) |
104 | goto badframe; | 99 | goto badframe; |
105 | 100 | ||
106 | return r0; | 101 | return r0; |
@@ -178,10 +173,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info, | |||
178 | /* Create the ucontext. */ | 173 | /* Create the ucontext. */ |
179 | err |= __put_user(0, &frame->uc.uc_flags); | 174 | err |= __put_user(0, &frame->uc.uc_flags); |
180 | err |= __put_user(0, &frame->uc.uc_link); | 175 | err |= __put_user(0, &frame->uc.uc_link); |
181 | err |= | 176 | err |= __save_altstack(&frame->uc.uc_stack, rdusp()); |
182 | __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | ||
183 | err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags); | ||
184 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
185 | err |= rt_setup_sigcontext(&frame->uc.uc_mcontext, regs); | 177 | err |= rt_setup_sigcontext(&frame->uc.uc_mcontext, regs); |
186 | err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 178 | err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
187 | 179 | ||
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig index f6a3648f5ec3..12d97b7ef0dc 100644 --- a/arch/c6x/Kconfig +++ b/arch/c6x/Kconfig | |||
@@ -18,6 +18,7 @@ config C6X | |||
18 | select OF_EARLY_FLATTREE | 18 | select OF_EARLY_FLATTREE |
19 | select GENERIC_CLOCKEVENTS | 19 | select GENERIC_CLOCKEVENTS |
20 | select MODULES_USE_ELF_RELA | 20 | select MODULES_USE_ELF_RELA |
21 | select GENERIC_SIGALTSTACK | ||
21 | 22 | ||
22 | config MMU | 23 | config MMU |
23 | def_bool n | 24 | def_bool n |
diff --git a/arch/c6x/kernel/entry.S b/arch/c6x/kernel/entry.S index 5239057de4c4..2721c90b0121 100644 --- a/arch/c6x/kernel/entry.S +++ b/arch/c6x/kernel/entry.S | |||
@@ -598,18 +598,6 @@ ENTRY(enable_exception) | |||
598 | NOP 5 | 598 | NOP 5 |
599 | ENDPROC(enable_exception) | 599 | ENDPROC(enable_exception) |
600 | 600 | ||
601 | ENTRY(sys_sigaltstack) | ||
602 | #ifdef CONFIG_C6X_BIG_KERNEL | ||
603 | MVKL .S1 do_sigaltstack,A0 ; branch to do_sigaltstack | ||
604 | MVKH .S1 do_sigaltstack,A0 | ||
605 | B .S2X A0 | ||
606 | #else | ||
607 | B .S2 do_sigaltstack | ||
608 | #endif | ||
609 | LDW .D2T1 *+SP(REGS_SP+8),A6 | ||
610 | NOP 4 | ||
611 | ENDPROC(sys_sigaltstack) | ||
612 | |||
613 | ;; | 601 | ;; |
614 | ;; Special system calls | 602 | ;; Special system calls |
615 | ;; return address is in B3 | 603 | ;; return address is in B3 |
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index c59a01dd9c0c..c2a1d0a8924c 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -50,6 +50,9 @@ config CRIS | |||
50 | select GENERIC_CMOS_UPDATE | 50 | select GENERIC_CMOS_UPDATE |
51 | select MODULES_USE_ELF_RELA | 51 | select MODULES_USE_ELF_RELA |
52 | select CLONE_BACKWARDS2 | 52 | select CLONE_BACKWARDS2 |
53 | select GENERIC_SIGALTSTACK | ||
54 | select OLD_SIGSUSPEND | ||
55 | select OLD_SIGACTION | ||
53 | 56 | ||
54 | config HZ | 57 | config HZ |
55 | int | 58 | int |
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 0bb477c13a4e..61ce6273a895 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -42,55 +42,6 @@ | |||
42 | void do_signal(int canrestart, struct pt_regs *regs); | 42 | void do_signal(int canrestart, struct pt_regs *regs); |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Atomically swap in the new signal mask, and wait for a signal. Define | ||
46 | * dummy arguments to be able to reach the regs argument. (Note that this | ||
47 | * arrangement relies on old_sigset_t occupying one register.) | ||
48 | */ | ||
49 | int sys_sigsuspend(old_sigset_t mask) | ||
50 | { | ||
51 | sigset_t blocked; | ||
52 | siginitset(&blocked, mask); | ||
53 | return sigsuspend(&blocked); | ||
54 | } | ||
55 | |||
56 | int sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
57 | struct old_sigaction *oact) | ||
58 | { | ||
59 | struct k_sigaction new_ka, old_ka; | ||
60 | int ret; | ||
61 | |||
62 | if (act) { | ||
63 | old_sigset_t mask; | ||
64 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
65 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
66 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
67 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
68 | __get_user(mask, &act->sa_mask)) | ||
69 | return -EFAULT; | ||
70 | siginitset(&new_ka.sa.sa_mask, mask); | ||
71 | } | ||
72 | |||
73 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
74 | |||
75 | if (!ret && oact) { | ||
76 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
77 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
78 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
79 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
80 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
81 | return -EFAULT; | ||
82 | } | ||
83 | |||
84 | return ret; | ||
85 | } | ||
86 | |||
87 | int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss) | ||
88 | { | ||
89 | return do_sigaltstack(uss, uoss, rdusp()); | ||
90 | } | ||
91 | |||
92 | |||
93 | /* | ||
94 | * Do a signal return; undo the signal stack. | 45 | * Do a signal return; undo the signal stack. |
95 | */ | 46 | */ |
96 | 47 | ||
@@ -150,11 +101,9 @@ badframe: | |||
150 | return 1; | 101 | return 1; |
151 | } | 102 | } |
152 | 103 | ||
153 | /* Define dummy arguments to be able to reach the regs argument. */ | 104 | asmlinkage int sys_sigreturn(void) |
154 | |||
155 | asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, | ||
156 | long srp, struct pt_regs *regs) | ||
157 | { | 105 | { |
106 | struct pt_regs *regs = current_pt_regs(); | ||
158 | struct sigframe __user *frame = (struct sigframe *)rdusp(); | 107 | struct sigframe __user *frame = (struct sigframe *)rdusp(); |
159 | sigset_t set; | 108 | sigset_t set; |
160 | 109 | ||
@@ -188,11 +137,9 @@ badframe: | |||
188 | return 0; | 137 | return 0; |
189 | } | 138 | } |
190 | 139 | ||
191 | /* Define dummy arguments to be able to reach the regs argument. */ | 140 | asmlinkage int sys_rt_sigreturn(void) |
192 | |||
193 | asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, | ||
194 | long mof, long srp, struct pt_regs *regs) | ||
195 | { | 141 | { |
142 | struct pt_regs *regs = current_pt_regs(); | ||
196 | struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); | 143 | struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); |
197 | sigset_t set; | 144 | sigset_t set; |
198 | 145 | ||
@@ -214,7 +161,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, | |||
214 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 161 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
215 | goto badframe; | 162 | goto badframe; |
216 | 163 | ||
217 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) | 164 | if (restore_altstack(&frame->uc.uc_stack)) |
218 | goto badframe; | 165 | goto badframe; |
219 | 166 | ||
220 | return regs->r10; | 167 | return regs->r10; |
@@ -362,6 +309,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
362 | 309 | ||
363 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 310 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
364 | 311 | ||
312 | err |= __save_altstack(&frame->uc.uc_stack, rdusp()); | ||
313 | |||
365 | if (err) | 314 | if (err) |
366 | goto give_sigsegv; | 315 | goto give_sigsegv; |
367 | 316 | ||
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index b60d1b65a426..01d1375c9004 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -51,59 +51,6 @@ struct rt_signal_frame { | |||
51 | void do_signal(int restart, struct pt_regs *regs); | 51 | void do_signal(int restart, struct pt_regs *regs); |
52 | void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, | 52 | void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, |
53 | struct pt_regs *regs); | 53 | struct pt_regs *regs); |
54 | /* | ||
55 | * Swap in the new signal mask, and wait for a signal. Define some | ||
56 | * dummy arguments to be able to reach the regs argument. | ||
57 | */ | ||
58 | int | ||
59 | sys_sigsuspend(old_sigset_t mask) | ||
60 | { | ||
61 | sigset_t blocked; | ||
62 | siginitset(&blocked, mask); | ||
63 | return sigsuspend(&blocked); | ||
64 | } | ||
65 | |||
66 | int | ||
67 | sys_sigaction(int signal, const struct old_sigaction *act, | ||
68 | struct old_sigaction *oact) | ||
69 | { | ||
70 | int retval; | ||
71 | struct k_sigaction newk; | ||
72 | struct k_sigaction oldk; | ||
73 | |||
74 | if (act) { | ||
75 | old_sigset_t mask; | ||
76 | |||
77 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
78 | __get_user(newk.sa.sa_handler, &act->sa_handler) || | ||
79 | __get_user(newk.sa.sa_restorer, &act->sa_restorer) || | ||
80 | __get_user(newk.sa.sa_flags, &act->sa_flags) || | ||
81 | __get_user(mask, &act->sa_mask)) | ||
82 | return -EFAULT; | ||
83 | |||
84 | siginitset(&newk.sa.sa_mask, mask); | ||
85 | } | ||
86 | |||
87 | retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL); | ||
88 | |||
89 | if (!retval && oact) { | ||
90 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
91 | __put_user(oldk.sa.sa_handler, &oact->sa_handler) || | ||
92 | __put_user(oldk.sa.sa_restorer, &oact->sa_restorer) || | ||
93 | __put_user(oldk.sa.sa_flags, &oact->sa_flags) || | ||
94 | __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
95 | return -EFAULT; | ||
96 | |||
97 | } | ||
98 | |||
99 | return retval; | ||
100 | } | ||
101 | |||
102 | int | ||
103 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
104 | { | ||
105 | return do_sigaltstack(uss, uoss, rdusp()); | ||
106 | } | ||
107 | 54 | ||
108 | static int | 55 | static int |
109 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | 56 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) |
@@ -135,11 +82,9 @@ badframe: | |||
135 | return 1; | 82 | return 1; |
136 | } | 83 | } |
137 | 84 | ||
138 | /* Define some dummy arguments to be able to reach the regs argument. */ | 85 | asmlinkage int sys_sigreturn(void) |
139 | asmlinkage int | ||
140 | sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, | ||
141 | struct pt_regs *regs) | ||
142 | { | 86 | { |
87 | struct pt_regs *regs = current_pt_regs(); | ||
143 | sigset_t set; | 88 | sigset_t set; |
144 | struct signal_frame __user *frame; | 89 | struct signal_frame __user *frame; |
145 | unsigned long oldspc = regs->spc; | 90 | unsigned long oldspc = regs->spc; |
@@ -178,11 +123,9 @@ badframe: | |||
178 | return 0; | 123 | return 0; |
179 | } | 124 | } |
180 | 125 | ||
181 | /* Define some dummy variables to be able to reach the regs argument. */ | 126 | asmlinkage int sys_rt_sigreturn(void) |
182 | asmlinkage int | ||
183 | sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, | ||
184 | struct pt_regs *regs) | ||
185 | { | 127 | { |
128 | struct pt_regs *regs = current_pt_regs(); | ||
186 | sigset_t set; | 129 | sigset_t set; |
187 | struct rt_signal_frame __user *frame; | 130 | struct rt_signal_frame __user *frame; |
188 | unsigned long oldspc = regs->spc; | 131 | unsigned long oldspc = regs->spc; |
@@ -209,7 +152,7 @@ sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, | |||
209 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 152 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
210 | goto badframe; | 153 | goto badframe; |
211 | 154 | ||
212 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) | 155 | if (restore_altstack(&frame->uc.uc_stack)) |
213 | goto badframe; | 156 | goto badframe; |
214 | 157 | ||
215 | keep_debug_flags(oldccs, oldspc, regs); | 158 | keep_debug_flags(oldccs, oldspc, regs); |
@@ -371,6 +314,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
371 | err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); | 314 | err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); |
372 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); | 315 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); |
373 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 316 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
317 | err |= __save_altstack(&frame->uc.uc_stack, rdusp()); | ||
374 | 318 | ||
375 | if (err) | 319 | if (err) |
376 | goto give_sigsegv; | 320 | goto give_sigsegv; |
diff --git a/arch/cris/include/asm/signal.h b/arch/cris/include/asm/signal.h index b3650ab2c320..c11b8745cece 100644 --- a/arch/cris/include/asm/signal.h +++ b/arch/cris/include/asm/signal.h | |||
@@ -16,13 +16,6 @@ typedef struct { | |||
16 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
17 | } sigset_t; | 17 | } sigset_t; |
18 | 18 | ||
19 | struct old_sigaction { | ||
20 | __sighandler_t sa_handler; | ||
21 | old_sigset_t sa_mask; | ||
22 | unsigned long sa_flags; | ||
23 | void (*sa_restorer)(void); | ||
24 | }; | ||
25 | |||
26 | #define __ARCH_HAS_SA_RESTORER | 19 | #define __ARCH_HAS_SA_RESTORER |
27 | 20 | ||
28 | #include <asm/sigcontext.h> | 21 | #include <asm/sigcontext.h> |
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 9d262645f667..e3f8ffdd4e7b 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -12,6 +12,9 @@ config FRV | |||
12 | select ARCH_HAVE_NMI_SAFE_CMPXCHG | 12 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
13 | select GENERIC_CPU_DEVICES | 13 | select GENERIC_CPU_DEVICES |
14 | select ARCH_WANT_IPC_PARSE_VERSION | 14 | select ARCH_WANT_IPC_PARSE_VERSION |
15 | select GENERIC_SIGALTSTACK | ||
16 | select OLD_SIGSUSPEND3 | ||
17 | select OLD_SIGACTION | ||
15 | 18 | ||
16 | config ZONE_DMA | 19 | config ZONE_DMA |
17 | bool | 20 | bool |
diff --git a/arch/frv/include/asm/signal.h b/arch/frv/include/asm/signal.h index 599500a31025..eca0abcb79d6 100644 --- a/arch/frv/include/asm/signal.h +++ b/arch/frv/include/asm/signal.h | |||
@@ -3,11 +3,4 @@ | |||
3 | 3 | ||
4 | #include <uapi/asm/signal.h> | 4 | #include <uapi/asm/signal.h> |
5 | 5 | ||
6 | struct old_sigaction { | ||
7 | __sighandler_t sa_handler; | ||
8 | old_sigset_t sa_mask; | ||
9 | unsigned long sa_flags; | ||
10 | __sigrestore_t sa_restorer; | ||
11 | }; | ||
12 | |||
13 | #endif /* _ASM_SIGNAL_H */ | 6 | #endif /* _ASM_SIGNAL_H */ |
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c index 535810a3217a..d822700d4f15 100644 --- a/arch/frv/kernel/signal.c +++ b/arch/frv/kernel/signal.c | |||
@@ -33,55 +33,6 @@ struct fdpic_func_descriptor { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Atomically swap in the new signal mask, and wait for a signal. | ||
37 | */ | ||
38 | asmlinkage int sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
39 | { | ||
40 | sigset_t blocked; | ||
41 | siginitset(&blocked, mask); | ||
42 | return sigsuspend(&blocked); | ||
43 | } | ||
44 | |||
45 | asmlinkage int sys_sigaction(int sig, | ||
46 | const struct old_sigaction __user *act, | ||
47 | struct old_sigaction __user *oact) | ||
48 | { | ||
49 | struct k_sigaction new_ka, old_ka; | ||
50 | int ret; | ||
51 | |||
52 | if (act) { | ||
53 | old_sigset_t mask; | ||
54 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
55 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
56 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
57 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
58 | __get_user(mask, &act->sa_mask)) | ||
59 | return -EFAULT; | ||
60 | siginitset(&new_ka.sa.sa_mask, mask); | ||
61 | } | ||
62 | |||
63 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
64 | |||
65 | if (!ret && oact) { | ||
66 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
67 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
68 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
69 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
70 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
71 | return -EFAULT; | ||
72 | } | ||
73 | |||
74 | return ret; | ||
75 | } | ||
76 | |||
77 | asmlinkage | ||
78 | int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
79 | { | ||
80 | return do_sigaltstack(uss, uoss, __frame->sp); | ||
81 | } | ||
82 | |||
83 | |||
84 | /* | ||
85 | * Do a signal return; undo the signal stack. | 36 | * Do a signal return; undo the signal stack. |
86 | */ | 37 | */ |
87 | 38 | ||
@@ -173,7 +124,7 @@ asmlinkage int sys_rt_sigreturn(void) | |||
173 | if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) | 124 | if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) |
174 | goto badframe; | 125 | goto badframe; |
175 | 126 | ||
176 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT) | 127 | if (restore_altstack(&frame->uc.uc_stack)) |
177 | goto badframe; | 128 | goto badframe; |
178 | 129 | ||
179 | return gr8; | 130 | return gr8; |
@@ -345,9 +296,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
345 | /* Create the ucontext. */ | 296 | /* Create the ucontext. */ |
346 | if (__put_user(0, &frame->uc.uc_flags) || | 297 | if (__put_user(0, &frame->uc.uc_flags) || |
347 | __put_user(NULL, &frame->uc.uc_link) || | 298 | __put_user(NULL, &frame->uc.uc_link) || |
348 | __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || | 299 | __save_altstack(&frame->uc.uc_stack, __frame->sp)) |
349 | __put_user(sas_ss_flags(__frame->sp), &frame->uc.uc_stack.ss_flags) || | ||
350 | __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size)) | ||
351 | goto give_sigsegv; | 300 | goto give_sigsegv; |
352 | 301 | ||
353 | if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0])) | 302 | if (setup_sigcontext(&frame->uc.uc_mcontext, set->sig[0])) |
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 2d2efb653ee0..0b0176ce2c35 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -9,6 +9,9 @@ config H8300 | |||
9 | select GENERIC_IRQ_SHOW | 9 | select GENERIC_IRQ_SHOW |
10 | select GENERIC_CPU_DEVICES | 10 | select GENERIC_CPU_DEVICES |
11 | select MODULES_USE_ELF_RELA | 11 | select MODULES_USE_ELF_RELA |
12 | select GENERIC_SIGALTSTACK | ||
13 | select OLD_SIGSUSPEND3 | ||
14 | select OLD_SIGACTION | ||
12 | 15 | ||
13 | config SYMBOL_PREFIX | 16 | config SYMBOL_PREFIX |
14 | string | 17 | string |
diff --git a/arch/h8300/include/asm/signal.h b/arch/h8300/include/asm/signal.h index 9b18a0959461..6341e36386f8 100644 --- a/arch/h8300/include/asm/signal.h +++ b/arch/h8300/include/asm/signal.h | |||
@@ -16,13 +16,6 @@ typedef struct { | |||
16 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
17 | } sigset_t; | 17 | } sigset_t; |
18 | 18 | ||
19 | struct old_sigaction { | ||
20 | __sighandler_t sa_handler; | ||
21 | old_sigset_t sa_mask; | ||
22 | unsigned long sa_flags; | ||
23 | void (*sa_restorer)(void); | ||
24 | }; | ||
25 | |||
26 | #define __ARCH_HAS_SA_RESTORER | 19 | #define __ARCH_HAS_SA_RESTORER |
27 | 20 | ||
28 | #include <asm/sigcontext.h> | 21 | #include <asm/sigcontext.h> |
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c index 0e81b96c642f..a65ff3b76326 100644 --- a/arch/h8300/kernel/signal.c +++ b/arch/h8300/kernel/signal.c | |||
@@ -47,56 +47,6 @@ | |||
47 | #include <asm/ucontext.h> | 47 | #include <asm/ucontext.h> |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Atomically swap in the new signal mask, and wait for a signal. | ||
51 | */ | ||
52 | asmlinkage int | ||
53 | sys_sigsuspend(int unused1, int unused2, old_sigset_t mask) | ||
54 | { | ||
55 | sigset_t blocked; | ||
56 | siginitset(&blocked, mask); | ||
57 | return sigsuspend(&blocked); | ||
58 | } | ||
59 | |||
60 | asmlinkage int | ||
61 | sys_sigaction(int sig, const struct old_sigaction *act, | ||
62 | struct old_sigaction *oact) | ||
63 | { | ||
64 | struct k_sigaction new_ka, old_ka; | ||
65 | int ret; | ||
66 | |||
67 | if (act) { | ||
68 | old_sigset_t mask; | ||
69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
71 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
72 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
73 | __get_user(mask, &act->sa_mask)) | ||
74 | return -EFAULT; | ||
75 | siginitset(&new_ka.sa.sa_mask, mask); | ||
76 | } | ||
77 | |||
78 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
79 | |||
80 | if (!ret && oact) { | ||
81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
83 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
84 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
85 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
86 | return -EFAULT; | ||
87 | } | ||
88 | |||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | asmlinkage int | ||
93 | sys_sigaltstack(const stack_t *uss, stack_t *uoss) | ||
94 | { | ||
95 | return do_sigaltstack(uss, uoss, rdusp()); | ||
96 | } | ||
97 | |||
98 | |||
99 | /* | ||
100 | * Do a signal return; undo the signal stack. | 50 | * Do a signal return; undo the signal stack. |
101 | * | 51 | * |
102 | * Keep the return code on the stack quadword aligned! | 52 | * Keep the return code on the stack quadword aligned! |
@@ -136,9 +86,9 @@ struct rt_sigframe | |||
136 | } __attribute__((aligned(2),packed)); | 86 | } __attribute__((aligned(2),packed)); |
137 | 87 | ||
138 | static inline int | 88 | static inline int |
139 | restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, | 89 | restore_sigcontext(struct sigcontext *usc, int *pd0) |
140 | int *pd0) | ||
141 | { | 90 | { |
91 | struct pt_regs *regs = current_pt_regs(); | ||
142 | int err = 0; | 92 | int err = 0; |
143 | unsigned int ccr; | 93 | unsigned int ccr; |
144 | unsigned int usp; | 94 | unsigned int usp; |
@@ -167,9 +117,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, | |||
167 | return err; | 117 | return err; |
168 | } | 118 | } |
169 | 119 | ||
170 | asmlinkage int do_sigreturn(unsigned long __unused,...) | 120 | asmlinkage int sys_sigreturn(void) |
171 | { | 121 | { |
172 | struct pt_regs *regs = (struct pt_regs *) (&__unused - 1); | ||
173 | unsigned long usp = rdusp(); | 122 | unsigned long usp = rdusp(); |
174 | struct sigframe *frame = (struct sigframe *)(usp - 4); | 123 | struct sigframe *frame = (struct sigframe *)(usp - 4); |
175 | sigset_t set; | 124 | sigset_t set; |
@@ -185,7 +134,7 @@ asmlinkage int do_sigreturn(unsigned long __unused,...) | |||
185 | 134 | ||
186 | set_current_blocked(&set); | 135 | set_current_blocked(&set); |
187 | 136 | ||
188 | if (restore_sigcontext(regs, &frame->sc, &er0)) | 137 | if (restore_sigcontext(&frame->sc, &er0)) |
189 | goto badframe; | 138 | goto badframe; |
190 | return er0; | 139 | return er0; |
191 | 140 | ||
@@ -194,9 +143,8 @@ badframe: | |||
194 | return 0; | 143 | return 0; |
195 | } | 144 | } |
196 | 145 | ||
197 | asmlinkage int do_rt_sigreturn(unsigned long __unused,...) | 146 | asmlinkage int sys_rt_sigreturn(void) |
198 | { | 147 | { |
199 | struct pt_regs *regs = (struct pt_regs *) &__unused; | ||
200 | unsigned long usp = rdusp(); | 148 | unsigned long usp = rdusp(); |
201 | struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); | 149 | struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); |
202 | sigset_t set; | 150 | sigset_t set; |
@@ -209,10 +157,10 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused,...) | |||
209 | 157 | ||
210 | set_current_blocked(&set); | 158 | set_current_blocked(&set); |
211 | 159 | ||
212 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &er0)) | 160 | if (restore_sigcontext(&frame->uc.uc_mcontext, &er0)) |
213 | goto badframe; | 161 | goto badframe; |
214 | 162 | ||
215 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, usp) == -EFAULT) | 163 | if (restore_altstack(&frame->uc.uc_stack)) |
216 | goto badframe; | 164 | goto badframe; |
217 | 165 | ||
218 | return er0; | 166 | return er0; |
@@ -358,11 +306,7 @@ static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, | |||
358 | /* Create the ucontext. */ | 306 | /* Create the ucontext. */ |
359 | err |= __put_user(0, &frame->uc.uc_flags); | 307 | err |= __put_user(0, &frame->uc.uc_flags); |
360 | err |= __put_user(0, &frame->uc.uc_link); | 308 | err |= __put_user(0, &frame->uc.uc_link); |
361 | err |= __put_user((void *)current->sas_ss_sp, | 309 | err |= __save_altstack(&frame->uc.uc_stack, rdusp()); |
362 | &frame->uc.uc_stack.ss_sp); | ||
363 | err |= __put_user(sas_ss_flags(rdusp()), | ||
364 | &frame->uc.uc_stack.ss_flags); | ||
365 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
366 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); | 310 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); |
367 | err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); | 311 | err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); |
368 | if (err) | 312 | if (err) |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index b74dd0ade58d..5c2168fb9b9e 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -334,18 +334,3 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
334 | .long SYMBOL_NAME(sys_getcpu) | 334 | .long SYMBOL_NAME(sys_getcpu) |
335 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */ | 335 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */ |
336 | .long SYMBOL_NAME(sys_setns) /* 320 */ | 336 | .long SYMBOL_NAME(sys_setns) /* 320 */ |
337 | |||
338 | .macro call_sp addr | ||
339 | mov.l #SYMBOL_NAME(\addr),er6 | ||
340 | bra SYMBOL_NAME(syscall_trampoline):8 | ||
341 | .endm | ||
342 | |||
343 | SYMBOL_NAME_LABEL(sys_sigreturn) | ||
344 | call_sp do_sigreturn | ||
345 | |||
346 | SYMBOL_NAME_LABEL(sys_rt_sigreturn) | ||
347 | call_sp do_rt_sigreturn | ||
348 | |||
349 | SYMBOL_NAME_LABEL(syscall_trampoline) | ||
350 | mov.l sp,er0 | ||
351 | jmp @er6 | ||
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 0744f7d7b1fd..3e6e27c11f93 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig | |||
@@ -31,6 +31,7 @@ config HEXAGON | |||
31 | select GENERIC_CLOCKEVENTS | 31 | select GENERIC_CLOCKEVENTS |
32 | select GENERIC_CLOCKEVENTS_BROADCAST | 32 | select GENERIC_CLOCKEVENTS_BROADCAST |
33 | select MODULES_USE_ELF_RELA | 33 | select MODULES_USE_ELF_RELA |
34 | select GENERIC_SIGALTSTACK | ||
34 | ---help--- | 35 | ---help--- |
35 | Qualcomm Hexagon is a processor architecture designed for high | 36 | Qualcomm Hexagon is a processor architecture designed for high |
36 | performance and low power across a wide variety of applications. | 37 | performance and low power across a wide variety of applications. |
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index fe0d1373165d..60fa2ca3202b 100644 --- a/arch/hexagon/kernel/signal.c +++ b/arch/hexagon/kernel/signal.c | |||
@@ -125,6 +125,7 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, | |||
125 | err |= __put_user(0x5400c004, &frame->tramp[1]); | 125 | err |= __put_user(0x5400c004, &frame->tramp[1]); |
126 | err |= setup_sigcontext(regs, &frame->uc.uc_mcontext); | 126 | err |= setup_sigcontext(regs, &frame->uc.uc_mcontext); |
127 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 127 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
128 | err |= __save_altstack(&frame->uc.uc_stack, user_stack_pointer(regs)); | ||
128 | if (err) | 129 | if (err) |
129 | goto sigsegv; | 130 | goto sigsegv; |
130 | 131 | ||
@@ -247,12 +248,6 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) | |||
247 | /* | 248 | /* |
248 | * Architecture-specific wrappers for signal-related system calls | 249 | * Architecture-specific wrappers for signal-related system calls |
249 | */ | 250 | */ |
250 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
251 | { | ||
252 | struct pt_regs *regs = current_pt_regs(); | ||
253 | |||
254 | return do_sigaltstack(uss, uoss, regs->r29); | ||
255 | } | ||
256 | 251 | ||
257 | asmlinkage int sys_rt_sigreturn(void) | 252 | asmlinkage int sys_rt_sigreturn(void) |
258 | { | 253 | { |
@@ -288,14 +283,7 @@ asmlinkage int sys_rt_sigreturn(void) | |||
288 | */ | 283 | */ |
289 | regs->syscall_nr = __NR_rt_sigreturn; | 284 | regs->syscall_nr = __NR_rt_sigreturn; |
290 | 285 | ||
291 | /* | 286 | if (restore_altstack(&frame->uc.uc_stack)) |
292 | * If we were meticulous, we'd only call this if we knew that | ||
293 | * we were actually going to use an alternate stack, and we'd | ||
294 | * consider any error to be fatal. What we do here, in common | ||
295 | * with many other architectures, is call it blindly and only | ||
296 | * consider the -EFAULT return case to be proof of a problem. | ||
297 | */ | ||
298 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, pt_psp(regs)) == -EFAULT) | ||
299 | goto badframe; | 287 | goto badframe; |
300 | 288 | ||
301 | return 0; | 289 | return 0; |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 3279646120e3..98482d1cbc5b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -42,6 +42,7 @@ config IA64 | |||
42 | select GENERIC_TIME_VSYSCALL_OLD | 42 | select GENERIC_TIME_VSYSCALL_OLD |
43 | select HAVE_MOD_ARCH_SPECIFIC | 43 | select HAVE_MOD_ARCH_SPECIFIC |
44 | select MODULES_USE_ELF_RELA | 44 | select MODULES_USE_ELF_RELA |
45 | select GENERIC_SIGALTSTACK | ||
45 | default y | 46 | default y |
46 | help | 47 | help |
47 | The Itanium Processor Family is Intel's 64-bit successor to | 48 | The Itanium Processor Family is Intel's 64-bit successor to |
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index 680b73786be8..3637e03d2282 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -39,14 +39,6 @@ | |||
39 | # define GET_SIGSET(k,u) __get_user((k)->sig[0], &(u)->sig[0]) | 39 | # define GET_SIGSET(k,u) __get_user((k)->sig[0], &(u)->sig[0]) |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | asmlinkage long | ||
43 | sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2, | ||
44 | long arg3, long arg4, long arg5, long arg6, long arg7, | ||
45 | struct pt_regs regs) | ||
46 | { | ||
47 | return do_sigaltstack(uss, uoss, regs.r12); | ||
48 | } | ||
49 | |||
50 | static long | 42 | static long |
51 | restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr) | 43 | restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr) |
52 | { | 44 | { |
@@ -208,11 +200,8 @@ ia64_rt_sigreturn (struct sigscratch *scr) | |||
208 | printk("SIG return (%s:%d): sp=%lx ip=%lx\n", | 200 | printk("SIG return (%s:%d): sp=%lx ip=%lx\n", |
209 | current->comm, current->pid, scr->pt.r12, scr->pt.cr_iip); | 201 | current->comm, current->pid, scr->pt.r12, scr->pt.cr_iip); |
210 | #endif | 202 | #endif |
211 | /* | 203 | if (restore_altstack(&sc->sc_stack)) |
212 | * It is more difficult to avoid calling this function than to | 204 | goto give_sigsegv; |
213 | * call it and ignore errors. | ||
214 | */ | ||
215 | do_sigaltstack(&sc->sc_stack, NULL, scr->pt.r12); | ||
216 | return retval; | 205 | return retval; |
217 | 206 | ||
218 | give_sigsegv: | 207 | give_sigsegv: |
@@ -376,9 +365,7 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, | |||
376 | 365 | ||
377 | err |= copy_siginfo_to_user(&frame->info, info); | 366 | err |= copy_siginfo_to_user(&frame->info, info); |
378 | 367 | ||
379 | err |= __put_user(current->sas_ss_sp, &frame->sc.sc_stack.ss_sp); | 368 | err |= __save_altstack(&frame->sc.sc_stack, scr->pt.r12); |
380 | err |= __put_user(current->sas_ss_size, &frame->sc.sc_stack.ss_size); | ||
381 | err |= __put_user(sas_ss_flags(scr->pt.r12), &frame->sc.sc_stack.ss_flags); | ||
382 | err |= setup_sigcontext(&frame->sc, set, scr); | 369 | err |= setup_sigcontext(&frame->sc, set, scr); |
383 | 370 | ||
384 | if (unlikely(err)) | 371 | if (unlikely(err)) |
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index f807721e19a5..1f550d4dd5d0 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -15,6 +15,7 @@ config M32R | |||
15 | select GENERIC_ATOMIC64 | 15 | select GENERIC_ATOMIC64 |
16 | select ARCH_USES_GETTIMEOFFSET | 16 | select ARCH_USES_GETTIMEOFFSET |
17 | select MODULES_USE_ELF_RELA | 17 | select MODULES_USE_ELF_RELA |
18 | select GENERIC_SIGALTSTACK | ||
18 | 19 | ||
19 | config SBUS | 20 | config SBUS |
20 | bool | 21 | bool |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index 6e3c26a1607c..d503568cb753 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
@@ -27,15 +27,6 @@ | |||
27 | 27 | ||
28 | #define DEBUG_SIG 0 | 28 | #define DEBUG_SIG 0 |
29 | 29 | ||
30 | asmlinkage int | ||
31 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
32 | unsigned long r2, unsigned long r3, unsigned long r4, | ||
33 | unsigned long r5, unsigned long r6, struct pt_regs *regs) | ||
34 | { | ||
35 | return do_sigaltstack(uss, uoss, regs->spu); | ||
36 | } | ||
37 | |||
38 | |||
39 | /* | 30 | /* |
40 | * Do a signal return; undo the signal stack. | 31 | * Do a signal return; undo the signal stack. |
41 | */ | 32 | */ |
@@ -113,7 +104,7 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1, | |||
113 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) | 104 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) |
114 | goto badframe; | 105 | goto badframe; |
115 | 106 | ||
116 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT) | 107 | if (restore_altstack(&frame->uc.uc_stack)) |
117 | goto badframe; | 108 | goto badframe; |
118 | 109 | ||
119 | return result; | 110 | return result; |
@@ -213,10 +204,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
213 | /* Create the ucontext. */ | 204 | /* Create the ucontext. */ |
214 | err |= __put_user(0, &frame->uc.uc_flags); | 205 | err |= __put_user(0, &frame->uc.uc_flags); |
215 | err |= __put_user(0, &frame->uc.uc_link); | 206 | err |= __put_user(0, &frame->uc.uc_link); |
216 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 207 | err |= __save_altstack(&frame->uc.uc_stack, regs->spu); |
217 | err |= __put_user(sas_ss_flags(regs->spu), | ||
218 | &frame->uc.uc_stack.ss_flags); | ||
219 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
220 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); | 208 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); |
221 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 209 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
222 | if (err) | 210 | if (err) |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 6710084e072a..a358bf63defe 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -18,6 +18,9 @@ config M68K | |||
18 | select HAVE_MOD_ARCH_SPECIFIC | 18 | select HAVE_MOD_ARCH_SPECIFIC |
19 | select MODULES_USE_ELF_REL | 19 | select MODULES_USE_ELF_REL |
20 | select MODULES_USE_ELF_RELA | 20 | select MODULES_USE_ELF_RELA |
21 | select GENERIC_SIGALTSTACK | ||
22 | select OLD_SIGSUSPEND3 | ||
23 | select OLD_SIGACTION | ||
21 | 24 | ||
22 | config RWSEM_GENERIC_SPINLOCK | 25 | config RWSEM_GENERIC_SPINLOCK |
23 | bool | 26 | bool |
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index c7b4fb1fa14d..214320b50384 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h | |||
@@ -16,13 +16,6 @@ typedef struct { | |||
16 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
17 | } sigset_t; | 17 | } sigset_t; |
18 | 18 | ||
19 | struct old_sigaction { | ||
20 | __sighandler_t sa_handler; | ||
21 | old_sigset_t sa_mask; | ||
22 | unsigned long sa_flags; | ||
23 | __sigrestore_t sa_restorer; | ||
24 | }; | ||
25 | |||
26 | #define __ARCH_HAS_SA_RESTORER | 19 | #define __ARCH_HAS_SA_RESTORER |
27 | 20 | ||
28 | #include <asm/sigcontext.h> | 21 | #include <asm/sigcontext.h> |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 9a396cda3147..2a16df3d9312 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -225,56 +225,6 @@ static inline void push_cache(unsigned long vaddr) | |||
225 | #endif /* CONFIG_MMU */ | 225 | #endif /* CONFIG_MMU */ |
226 | 226 | ||
227 | /* | 227 | /* |
228 | * Atomically swap in the new signal mask, and wait for a signal. | ||
229 | */ | ||
230 | asmlinkage int | ||
231 | sys_sigsuspend(int unused0, int unused1, old_sigset_t mask) | ||
232 | { | ||
233 | sigset_t blocked; | ||
234 | siginitset(&blocked, mask); | ||
235 | return sigsuspend(&blocked); | ||
236 | } | ||
237 | |||
238 | asmlinkage int | ||
239 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
240 | struct old_sigaction __user *oact) | ||
241 | { | ||
242 | struct k_sigaction new_ka, old_ka; | ||
243 | int ret; | ||
244 | |||
245 | if (act) { | ||
246 | old_sigset_t mask; | ||
247 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
248 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
249 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
250 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
251 | __get_user(mask, &act->sa_mask)) | ||
252 | return -EFAULT; | ||
253 | siginitset(&new_ka.sa.sa_mask, mask); | ||
254 | } | ||
255 | |||
256 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
257 | |||
258 | if (!ret && oact) { | ||
259 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
260 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
261 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
262 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
263 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
264 | return -EFAULT; | ||
265 | } | ||
266 | |||
267 | return ret; | ||
268 | } | ||
269 | |||
270 | asmlinkage int | ||
271 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
272 | { | ||
273 | return do_sigaltstack(uss, uoss, rdusp()); | ||
274 | } | ||
275 | |||
276 | |||
277 | /* | ||
278 | * Do a signal return; undo the signal stack. | 228 | * Do a signal return; undo the signal stack. |
279 | * | 229 | * |
280 | * Keep the return code on the stack quadword aligned! | 230 | * Keep the return code on the stack quadword aligned! |
@@ -765,8 +715,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, | |||
765 | err |= __get_user(temp, &uc->uc_formatvec); | 715 | err |= __get_user(temp, &uc->uc_formatvec); |
766 | 716 | ||
767 | err |= rt_restore_fpu_state(uc); | 717 | err |= rt_restore_fpu_state(uc); |
718 | err |= restore_altstack(&uc->uc_stack); | ||
768 | 719 | ||
769 | if (err || do_sigaltstack(&uc->uc_stack, NULL, usp) == -EFAULT) | 720 | if (err) |
770 | goto badframe; | 721 | goto badframe; |
771 | 722 | ||
772 | if (mangle_kernel_stack(regs, temp, &uc->uc_extra)) | 723 | if (mangle_kernel_stack(regs, temp, &uc->uc_extra)) |
@@ -1014,11 +965,7 @@ static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, | |||
1014 | /* Create the ucontext. */ | 965 | /* Create the ucontext. */ |
1015 | err |= __put_user(0, &frame->uc.uc_flags); | 966 | err |= __put_user(0, &frame->uc.uc_flags); |
1016 | err |= __put_user(NULL, &frame->uc.uc_link); | 967 | err |= __put_user(NULL, &frame->uc.uc_link); |
1017 | err |= __put_user((void __user *)current->sas_ss_sp, | 968 | err |= __save_altstack(&frame->uc.uc_stack, rdusp()); |
1018 | &frame->uc.uc_stack.ss_sp); | ||
1019 | err |= __put_user(sas_ss_flags(rdusp()), | ||
1020 | &frame->uc.uc_stack.ss_flags); | ||
1021 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
1022 | err |= rt_setup_ucontext(&frame->uc, regs); | 969 | err |= rt_setup_ucontext(&frame->uc, regs); |
1023 | err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); | 970 | err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); |
1024 | 971 | ||
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index ba3b7c8c04b8..5e30d75c74ed 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig | |||
@@ -27,6 +27,7 @@ config MICROBLAZE | |||
27 | select GENERIC_CLOCKEVENTS | 27 | select GENERIC_CLOCKEVENTS |
28 | select MODULES_USE_ELF_RELA | 28 | select MODULES_USE_ELF_RELA |
29 | select CLONE_BACKWARDS | 29 | select CLONE_BACKWARDS |
30 | select GENERIC_SIGALTSTACK | ||
30 | 31 | ||
31 | config SWAP | 32 | config SWAP |
32 | def_bool n | 33 | def_bool n |
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S index 70da83a49670..7e394fc2c439 100644 --- a/arch/microblaze/kernel/entry-nommu.S +++ b/arch/microblaze/kernel/entry-nommu.S | |||
@@ -124,6 +124,7 @@ ret_from_intr: | |||
124 | lwi r11, r1, PT_MODE | 124 | lwi r11, r1, PT_MODE |
125 | bneid r11, no_intr_resched | 125 | bneid r11, no_intr_resched |
126 | 126 | ||
127 | 3: | ||
127 | lwi r6, r31, TS_THREAD_INFO /* get thread info */ | 128 | lwi r6, r31, TS_THREAD_INFO /* get thread info */ |
128 | lwi r19, r6, TI_FLAGS /* get flags in thread info */ | 129 | lwi r19, r6, TI_FLAGS /* get flags in thread info */ |
129 | /* do an extra work if any bits are set */ | 130 | /* do an extra work if any bits are set */ |
@@ -132,11 +133,13 @@ ret_from_intr: | |||
132 | beqi r11, 1f | 133 | beqi r11, 1f |
133 | bralid r15, schedule | 134 | bralid r15, schedule |
134 | nop | 135 | nop |
136 | bri 3b | ||
135 | 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME | 137 | 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME |
136 | beqid r11, no_intr_resched | 138 | beqid r11, no_intr_resched |
137 | addk r5, r1, r0 | 139 | addk r5, r1, r0 |
138 | bralid r15, do_notify_resume | 140 | bralid r15, do_notify_resume |
139 | addk r6, r0, r0 | 141 | addk r6, r0, r0 |
142 | bri 3b | ||
140 | 143 | ||
141 | no_intr_resched: | 144 | no_intr_resched: |
142 | /* Disable interrupts, we are now committed to the state restore */ | 145 | /* Disable interrupts, we are now committed to the state restore */ |
@@ -280,6 +283,7 @@ ENTRY(_user_exception) | |||
280 | /* Figure out which function to use for this system call. */ | 283 | /* Figure out which function to use for this system call. */ |
281 | /* Note Microblaze barrel shift is optional, so don't rely on it */ | 284 | /* Note Microblaze barrel shift is optional, so don't rely on it */ |
282 | add r12, r12, r12 /* convert num -> ptr */ | 285 | add r12, r12, r12 /* convert num -> ptr */ |
286 | addik r30, r0, 1 /* restarts allowed */ | ||
283 | add r12, r12, r12 | 287 | add r12, r12, r12 |
284 | lwi r12, r12, sys_call_table /* Get function pointer */ | 288 | lwi r12, r12, sys_call_table /* Get function pointer */ |
285 | addik r15, r0, ret_to_user-8 /* set return address */ | 289 | addik r15, r0, ret_to_user-8 /* set return address */ |
@@ -369,6 +373,7 @@ ENTRY(_debug_exception) | |||
369 | bralid r15, send_sig | 373 | bralid r15, send_sig |
370 | add r7, r0, r0 /* 3rd param zero */ | 374 | add r7, r0, r0 /* 3rd param zero */ |
371 | 375 | ||
376 | addik r30, r0, 1 /* restarts allowed ??? */ | ||
372 | /* Restore r3/r4 to work around how ret_to_user works */ | 377 | /* Restore r3/r4 to work around how ret_to_user works */ |
373 | lwi r3, r1, PT_R3 | 378 | lwi r3, r1, PT_R3 |
374 | lwi r4, r1, PT_R4 | 379 | lwi r4, r1, PT_R4 |
@@ -482,18 +487,26 @@ ENTRY(ret_from_kernel_thread) | |||
482 | addk r3, r0, r0 | 487 | addk r3, r0, r0 |
483 | 488 | ||
484 | work_pending: | 489 | work_pending: |
490 | lwi r11, r1, PT_MODE | ||
491 | bneid r11, 2f | ||
492 | 3: | ||
485 | enable_irq | 493 | enable_irq |
486 | |||
487 | andi r11, r19, _TIF_NEED_RESCHED | 494 | andi r11, r19, _TIF_NEED_RESCHED |
488 | beqi r11, 1f | 495 | beqi r11, 1f |
489 | bralid r15, schedule | 496 | bralid r15, schedule |
490 | nop | 497 | nop |
498 | bri 4f | ||
491 | 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME | 499 | 1: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME |
492 | beqi r11, no_work_pending | 500 | beqi r11, no_work_pending |
493 | addk r5, r1, r0 | 501 | addk r5, r30, r0 |
494 | bralid r15, do_notify_resume | 502 | bralid r15, do_notify_resume |
495 | addik r6, r0, 1 | 503 | addik r6, r0, 1 |
496 | bri no_work_pending | 504 | addk r30, r0, r0 /* no restarts from now on */ |
505 | 4: | ||
506 | disable_irq | ||
507 | lwi r6, r31, TS_THREAD_INFO /* get thread info */ | ||
508 | lwi r19, r6, TI_FLAGS /* get flags in thread info */ | ||
509 | bri 3b | ||
497 | 510 | ||
498 | ENTRY(ret_to_user) | 511 | ENTRY(ret_to_user) |
499 | disable_irq | 512 | disable_irq |
@@ -507,6 +520,7 @@ ENTRY(ret_to_user) | |||
507 | no_work_pending: | 520 | no_work_pending: |
508 | disable_irq | 521 | disable_irq |
509 | 522 | ||
523 | 2: | ||
510 | /* save r31 */ | 524 | /* save r31 */ |
511 | swi r31, r0, PER_CPU(CURRENT_SAVE) | 525 | swi r31, r0, PER_CPU(CURRENT_SAVE) |
512 | /* save mode indicator */ | 526 | /* save mode indicator */ |
@@ -559,6 +573,7 @@ no_work_pending: | |||
559 | nop | 573 | nop |
560 | 574 | ||
561 | sys_rt_sigreturn_wrapper: | 575 | sys_rt_sigreturn_wrapper: |
576 | addk r30, r0, r0 /* no restarts for this one */ | ||
562 | brid sys_rt_sigreturn | 577 | brid sys_rt_sigreturn |
563 | addk r5, r1, r0 | 578 | addk r5, r1, r0 |
564 | 579 | ||
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index c217367dfc7b..0536bc021cc6 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -354,6 +354,7 @@ C_ENTRY(_user_exception): | |||
354 | /* Note Microblaze barrel shift is optional, so don't rely on it */ | 354 | /* Note Microblaze barrel shift is optional, so don't rely on it */ |
355 | add r12, r12, r12; /* convert num -> ptr */ | 355 | add r12, r12, r12; /* convert num -> ptr */ |
356 | add r12, r12, r12; | 356 | add r12, r12, r12; |
357 | addi r30, r0, 1 /* restarts allowed */ | ||
357 | 358 | ||
358 | #ifdef DEBUG | 359 | #ifdef DEBUG |
359 | /* Trac syscalls and stored them to syscall_debug_table */ | 360 | /* Trac syscalls and stored them to syscall_debug_table */ |
@@ -401,26 +402,27 @@ C_ENTRY(ret_from_trap): | |||
401 | * trigger rescheduling. */ | 402 | * trigger rescheduling. */ |
402 | /* get thread info from current task */ | 403 | /* get thread info from current task */ |
403 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; | 404 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; |
404 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 405 | lwi r19, r11, TI_FLAGS; /* get flags in thread info */ |
405 | andi r11, r11, _TIF_NEED_RESCHED; | 406 | andi r11, r19, _TIF_NEED_RESCHED; |
406 | beqi r11, 5f; | 407 | beqi r11, 5f; |
407 | 408 | ||
408 | bralid r15, schedule; /* Call scheduler */ | 409 | bralid r15, schedule; /* Call scheduler */ |
409 | nop; /* delay slot */ | 410 | nop; /* delay slot */ |
411 | bri 1b | ||
410 | 412 | ||
411 | /* Maybe handle a signal */ | 413 | /* Maybe handle a signal */ |
412 | 5: /* get thread info from current task*/ | 414 | 5: |
413 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; | 415 | andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; |
414 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 416 | beqi r11, 4f; /* Signals to handle, handle them */ |
415 | andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; | ||
416 | beqi r11, 1f; /* Signals to handle, handle them */ | ||
417 | 417 | ||
418 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ | 418 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ |
419 | bralid r15, do_notify_resume; /* Handle any signals */ | 419 | bralid r15, do_notify_resume; /* Handle any signals */ |
420 | addi r6, r0, 1; /* Arg 2: int in_syscall */ | 420 | add r6, r30, r0; /* Arg 2: int in_syscall */ |
421 | add r30, r0, r0 /* no more restarts */ | ||
422 | bri 1b | ||
421 | 423 | ||
422 | /* Finally, return to user state. */ | 424 | /* Finally, return to user state. */ |
423 | 1: set_bip; /* Ints masked for state restore */ | 425 | 4: set_bip; /* Ints masked for state restore */ |
424 | swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ | 426 | swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ |
425 | VM_OFF; | 427 | VM_OFF; |
426 | tophys(r1,r1); | 428 | tophys(r1,r1); |
@@ -464,6 +466,7 @@ C_ENTRY(ret_from_kernel_thread): | |||
464 | add r3, r0, r0 | 466 | add r3, r0, r0 |
465 | 467 | ||
466 | C_ENTRY(sys_rt_sigreturn_wrapper): | 468 | C_ENTRY(sys_rt_sigreturn_wrapper): |
469 | addik r30, r0, 0 /* no restarts */ | ||
467 | brid sys_rt_sigreturn /* Do real work */ | 470 | brid sys_rt_sigreturn /* Do real work */ |
468 | addik r5, r1, 0; /* add user context as 1st arg */ | 471 | addik r5, r1, 0; /* add user context as 1st arg */ |
469 | 472 | ||
@@ -571,20 +574,20 @@ C_ENTRY(ret_from_exc): | |||
571 | 574 | ||
572 | /* We're returning to user mode, so check for various conditions that | 575 | /* We're returning to user mode, so check for various conditions that |
573 | trigger rescheduling. */ | 576 | trigger rescheduling. */ |
577 | 1: | ||
574 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ | 578 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ |
575 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 579 | lwi r19, r11, TI_FLAGS; /* get flags in thread info */ |
576 | andi r11, r11, _TIF_NEED_RESCHED; | 580 | andi r11, r19, _TIF_NEED_RESCHED; |
577 | beqi r11, 5f; | 581 | beqi r11, 5f; |
578 | 582 | ||
579 | /* Call the scheduler before returning from a syscall/trap. */ | 583 | /* Call the scheduler before returning from a syscall/trap. */ |
580 | bralid r15, schedule; /* Call scheduler */ | 584 | bralid r15, schedule; /* Call scheduler */ |
581 | nop; /* delay slot */ | 585 | nop; /* delay slot */ |
586 | bri 1b | ||
582 | 587 | ||
583 | /* Maybe handle a signal */ | 588 | /* Maybe handle a signal */ |
584 | 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ | 589 | 5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; |
585 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 590 | beqi r11, 4f; /* Signals to handle, handle them */ |
586 | andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; | ||
587 | beqi r11, 1f; /* Signals to handle, handle them */ | ||
588 | 591 | ||
589 | /* | 592 | /* |
590 | * Handle a signal return; Pending signals should be in r18. | 593 | * Handle a signal return; Pending signals should be in r18. |
@@ -600,9 +603,10 @@ C_ENTRY(ret_from_exc): | |||
600 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ | 603 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ |
601 | bralid r15, do_notify_resume; /* Handle any signals */ | 604 | bralid r15, do_notify_resume; /* Handle any signals */ |
602 | addi r6, r0, 0; /* Arg 2: int in_syscall */ | 605 | addi r6, r0, 0; /* Arg 2: int in_syscall */ |
606 | bri 1b | ||
603 | 607 | ||
604 | /* Finally, return to user state. */ | 608 | /* Finally, return to user state. */ |
605 | 1: set_bip; /* Ints masked for state restore */ | 609 | 4: set_bip; /* Ints masked for state restore */ |
606 | swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ | 610 | swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ |
607 | VM_OFF; | 611 | VM_OFF; |
608 | tophys(r1,r1); | 612 | tophys(r1,r1); |
@@ -682,22 +686,23 @@ ret_from_irq: | |||
682 | lwi r11, r1, PT_MODE; | 686 | lwi r11, r1, PT_MODE; |
683 | bnei r11, 2f; | 687 | bnei r11, 2f; |
684 | 688 | ||
689 | 1: | ||
685 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; | 690 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; |
686 | lwi r11, r11, TI_FLAGS; /* MS: get flags from thread info */ | 691 | lwi r19, r11, TI_FLAGS; /* MS: get flags from thread info */ |
687 | andi r11, r11, _TIF_NEED_RESCHED; | 692 | andi r11, r19, _TIF_NEED_RESCHED; |
688 | beqi r11, 5f | 693 | beqi r11, 5f |
689 | bralid r15, schedule; | 694 | bralid r15, schedule; |
690 | nop; /* delay slot */ | 695 | nop; /* delay slot */ |
696 | bri 1b | ||
691 | 697 | ||
692 | /* Maybe handle a signal */ | 698 | /* Maybe handle a signal */ |
693 | 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* MS: get thread info */ | 699 | 5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; |
694 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | ||
695 | andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; | ||
696 | beqid r11, no_intr_resched | 700 | beqid r11, no_intr_resched |
697 | /* Handle a signal return; Pending signals should be in r18. */ | 701 | /* Handle a signal return; Pending signals should be in r18. */ |
698 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ | 702 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ |
699 | bralid r15, do_notify_resume; /* Handle any signals */ | 703 | bralid r15, do_notify_resume; /* Handle any signals */ |
700 | addi r6, r0, 0; /* Arg 2: int in_syscall */ | 704 | addi r6, r0, 0; /* Arg 2: int in_syscall */ |
705 | bri 1b | ||
701 | 706 | ||
702 | /* Finally, return to user state. */ | 707 | /* Finally, return to user state. */ |
703 | no_intr_resched: | 708 | no_intr_resched: |
@@ -815,28 +820,29 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */ | |||
815 | lwi r11, r1, PT_MODE; | 820 | lwi r11, r1, PT_MODE; |
816 | bnei r11, 2f; | 821 | bnei r11, 2f; |
817 | /* MS: Return to user space - gdb */ | 822 | /* MS: Return to user space - gdb */ |
823 | 1: | ||
818 | /* Get current task ptr into r11 */ | 824 | /* Get current task ptr into r11 */ |
819 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ | 825 | lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ |
820 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 826 | lwi r19, r11, TI_FLAGS; /* get flags in thread info */ |
821 | andi r11, r11, _TIF_NEED_RESCHED; | 827 | andi r11, r19, _TIF_NEED_RESCHED; |
822 | beqi r11, 5f; | 828 | beqi r11, 5f; |
823 | 829 | ||
824 | /* Call the scheduler before returning from a syscall/trap. */ | 830 | /* Call the scheduler before returning from a syscall/trap. */ |
825 | bralid r15, schedule; /* Call scheduler */ | 831 | bralid r15, schedule; /* Call scheduler */ |
826 | nop; /* delay slot */ | 832 | nop; /* delay slot */ |
833 | bri 1b | ||
827 | 834 | ||
828 | /* Maybe handle a signal */ | 835 | /* Maybe handle a signal */ |
829 | 5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ | 836 | 5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; |
830 | lwi r11, r11, TI_FLAGS; /* get flags in thread info */ | 837 | beqi r11, 4f; /* Signals to handle, handle them */ |
831 | andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; | ||
832 | beqi r11, 1f; /* Signals to handle, handle them */ | ||
833 | 838 | ||
834 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ | 839 | addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ |
835 | bralid r15, do_notify_resume; /* Handle any signals */ | 840 | bralid r15, do_notify_resume; /* Handle any signals */ |
836 | addi r6, r0, 0; /* Arg 2: int in_syscall */ | 841 | addi r6, r0, 0; /* Arg 2: int in_syscall */ |
842 | bri 1b | ||
837 | 843 | ||
838 | /* Finally, return to user state. */ | 844 | /* Finally, return to user state. */ |
839 | 1: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ | 845 | 4: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ |
840 | VM_OFF; | 846 | VM_OFF; |
841 | tophys(r1,r1); | 847 | tophys(r1,r1); |
842 | /* MS: Restore all regs */ | 848 | /* MS: Restore all regs */ |
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c index ab1b9db661f3..b050219c42e6 100644 --- a/arch/microblaze/kernel/ptrace.c +++ b/arch/microblaze/kernel/ptrace.c | |||
@@ -164,29 +164,6 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) | |||
164 | tracehook_report_syscall_exit(regs, step); | 164 | tracehook_report_syscall_exit(regs, step); |
165 | } | 165 | } |
166 | 166 | ||
167 | #if 0 | ||
168 | static asmlinkage void syscall_trace(void) | ||
169 | { | ||
170 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
171 | return; | ||
172 | if (!(current->ptrace & PT_PTRACED)) | ||
173 | return; | ||
174 | /* The 0x80 provides a way for the tracing parent to distinguish | ||
175 | between a syscall stop and SIGTRAP delivery */ | ||
176 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
177 | ? 0x80 : 0)); | ||
178 | /* | ||
179 | * this isn't the same as continuing with a signal, but it will do | ||
180 | * for normal use. strace only continues with a signal if the | ||
181 | * stopping signal is not SIGTRAP. -brl | ||
182 | */ | ||
183 | if (current->exit_code) { | ||
184 | send_sig(current->exit_code, current, 1); | ||
185 | current->exit_code = 0; | ||
186 | } | ||
187 | } | ||
188 | #endif | ||
189 | |||
190 | void ptrace_disable(struct task_struct *child) | 167 | void ptrace_disable(struct task_struct *child) |
191 | { | 168 | { |
192 | /* nothing to do */ | 169 | /* nothing to do */ |
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index ac3d0a0f4814..9f7a8bde0686 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c | |||
@@ -41,13 +41,6 @@ | |||
41 | #include <asm/cacheflush.h> | 41 | #include <asm/cacheflush.h> |
42 | #include <asm/syscalls.h> | 42 | #include <asm/syscalls.h> |
43 | 43 | ||
44 | asmlinkage long | ||
45 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
46 | struct pt_regs *regs) | ||
47 | { | ||
48 | return do_sigaltstack(uss, uoss, regs->r1); | ||
49 | } | ||
50 | |||
51 | /* | 44 | /* |
52 | * Do a signal return; undo the signal stack. | 45 | * Do a signal return; undo the signal stack. |
53 | */ | 46 | */ |
@@ -109,9 +102,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) | |||
109 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) | 102 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval)) |
110 | goto badframe; | 103 | goto badframe; |
111 | 104 | ||
112 | /* It is more difficult to avoid calling this function than to | 105 | if (restore_altstack(&frame->uc.uc_stack)) |
113 | call it and ignore errors. */ | ||
114 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->r1) == -EFAULT) | ||
115 | goto badframe; | 106 | goto badframe; |
116 | 107 | ||
117 | return rval; | 108 | return rval; |
@@ -194,11 +185,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
194 | /* Create the ucontext. */ | 185 | /* Create the ucontext. */ |
195 | err |= __put_user(0, &frame->uc.uc_flags); | 186 | err |= __put_user(0, &frame->uc.uc_flags); |
196 | err |= __put_user(NULL, &frame->uc.uc_link); | 187 | err |= __put_user(NULL, &frame->uc.uc_link); |
197 | err |= __put_user((void __user *)current->sas_ss_sp, | 188 | err |= __save_altstack(&frame->uc.uc_stack, regs->r1); |
198 | &frame->uc.uc_stack.ss_sp); | ||
199 | err |= __put_user(sas_ss_flags(regs->r1), | ||
200 | &frame->uc.uc_stack.ss_flags); | ||
201 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
202 | err |= setup_sigcontext(&frame->uc.uc_mcontext, | 189 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
203 | regs, set->sig[0]); | 190 | regs, set->sig[0]); |
204 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 191 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
@@ -356,15 +343,6 @@ static void do_signal(struct pt_regs *regs, int in_syscall) | |||
356 | 343 | ||
357 | asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall) | 344 | asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall) |
358 | { | 345 | { |
359 | /* | ||
360 | * We want the common case to go fast, which | ||
361 | * is why we may in certain cases get here from | ||
362 | * kernel mode. Just return without doing anything | ||
363 | * if so. | ||
364 | */ | ||
365 | if (kernel_mode(regs)) | ||
366 | return; | ||
367 | |||
368 | if (test_thread_flag(TIF_SIGPENDING)) | 346 | if (test_thread_flag(TIF_SIGPENDING)) |
369 | do_signal(regs, in_syscall); | 347 | do_signal(regs, in_syscall); |
370 | 348 | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 2ac626ab9d43..0772b5c5bc72 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -41,6 +41,12 @@ config MIPS | |||
41 | select HAVE_MOD_ARCH_SPECIFIC | 41 | select HAVE_MOD_ARCH_SPECIFIC |
42 | select MODULES_USE_ELF_REL if MODULES | 42 | select MODULES_USE_ELF_REL if MODULES |
43 | select MODULES_USE_ELF_RELA if MODULES && 64BIT | 43 | select MODULES_USE_ELF_RELA if MODULES && 64BIT |
44 | select CLONE_BACKWARDS | ||
45 | select GENERIC_SIGALTSTACK | ||
46 | select GENERIC_COMPAT_RT_SIGACTION | ||
47 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
48 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
49 | select GENERIC_COMPAT_RT_SIGPENDING | ||
44 | 50 | ||
45 | menu "Machine selection" | 51 | menu "Machine selection" |
46 | 52 | ||
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 3c5d1464b7bd..ebaae9649f8a 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
@@ -288,6 +288,14 @@ struct compat_shmid64_ds { | |||
288 | compat_ulong_t __unused2; | 288 | compat_ulong_t __unused2; |
289 | }; | 289 | }; |
290 | 290 | ||
291 | /* MIPS has unusual order of fields in stack_t */ | ||
292 | typedef struct compat_sigaltstack { | ||
293 | compat_uptr_t ss_sp; | ||
294 | compat_size_t ss_size; | ||
295 | int ss_flags; | ||
296 | } compat_stack_t; | ||
297 | #define compat_sigaltstack compat_sigaltstack | ||
298 | |||
291 | static inline int is_compat_task(void) | 299 | static inline int is_compat_task(void) |
292 | { | 300 | { |
293 | return test_thread_flag(TIF_32BIT_ADDR); | 301 | return test_thread_flag(TIF_32BIT_ADDR); |
diff --git a/arch/mips/include/asm/sim.h b/arch/mips/include/asm/sim.h index 0cd719fabb51..91831800c480 100644 --- a/arch/mips/include/asm/sim.h +++ b/arch/mips/include/asm/sim.h | |||
@@ -20,10 +20,10 @@ | |||
20 | #define save_static_function(symbol) \ | 20 | #define save_static_function(symbol) \ |
21 | __asm__( \ | 21 | __asm__( \ |
22 | ".text\n\t" \ | 22 | ".text\n\t" \ |
23 | ".globl\t" #symbol "\n\t" \ | 23 | ".globl\t__" #symbol "\n\t" \ |
24 | ".align\t2\n\t" \ | 24 | ".align\t2\n\t" \ |
25 | ".type\t" #symbol ", @function\n\t" \ | 25 | ".type\t__" #symbol ", @function\n\t" \ |
26 | ".ent\t" #symbol ", 0\n" \ | 26 | ".ent\t__" #symbol ", 0\n__" \ |
27 | #symbol":\n\t" \ | 27 | #symbol":\n\t" \ |
28 | ".frame\t$29, 0, $31\n\t" \ | 28 | ".frame\t$29, 0, $31\n\t" \ |
29 | "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ | 29 | "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ |
@@ -35,9 +35,9 @@ __asm__( \ | |||
35 | "sw\t$22,"__str(PT_R22)"($29)\n\t" \ | 35 | "sw\t$22,"__str(PT_R22)"($29)\n\t" \ |
36 | "sw\t$23,"__str(PT_R23)"($29)\n\t" \ | 36 | "sw\t$23,"__str(PT_R23)"($29)\n\t" \ |
37 | "sw\t$30,"__str(PT_R30)"($29)\n\t" \ | 37 | "sw\t$30,"__str(PT_R30)"($29)\n\t" \ |
38 | "j\t_" #symbol "\n\t" \ | 38 | "j\t" #symbol "\n\t" \ |
39 | ".end\t" #symbol "\n\t" \ | 39 | ".end\t__" #symbol "\n\t" \ |
40 | ".size\t" #symbol",. - " #symbol) | 40 | ".size\t__" #symbol",. - __" #symbol) |
41 | 41 | ||
42 | #define nabi_no_regargs | 42 | #define nabi_no_regargs |
43 | 43 | ||
@@ -48,10 +48,10 @@ __asm__( \ | |||
48 | #define save_static_function(symbol) \ | 48 | #define save_static_function(symbol) \ |
49 | __asm__( \ | 49 | __asm__( \ |
50 | ".text\n\t" \ | 50 | ".text\n\t" \ |
51 | ".globl\t" #symbol "\n\t" \ | 51 | ".globl\t__" #symbol "\n\t" \ |
52 | ".align\t2\n\t" \ | 52 | ".align\t2\n\t" \ |
53 | ".type\t" #symbol ", @function\n\t" \ | 53 | ".type\t__" #symbol ", @function\n\t" \ |
54 | ".ent\t" #symbol ", 0\n" \ | 54 | ".ent\t__" #symbol ", 0\n__" \ |
55 | #symbol":\n\t" \ | 55 | #symbol":\n\t" \ |
56 | ".frame\t$29, 0, $31\n\t" \ | 56 | ".frame\t$29, 0, $31\n\t" \ |
57 | "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ | 57 | "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ |
@@ -63,9 +63,9 @@ __asm__( \ | |||
63 | "sd\t$22,"__str(PT_R22)"($29)\n\t" \ | 63 | "sd\t$22,"__str(PT_R22)"($29)\n\t" \ |
64 | "sd\t$23,"__str(PT_R23)"($29)\n\t" \ | 64 | "sd\t$23,"__str(PT_R23)"($29)\n\t" \ |
65 | "sd\t$30,"__str(PT_R30)"($29)\n\t" \ | 65 | "sd\t$30,"__str(PT_R30)"($29)\n\t" \ |
66 | "j\t_" #symbol "\n\t" \ | 66 | "j\t" #symbol "\n\t" \ |
67 | ".end\t" #symbol "\n\t" \ | 67 | ".end\t__" #symbol "\n\t" \ |
68 | ".size\t" #symbol",. - " #symbol) | 68 | ".size\t__" #symbol",. - __" #symbol) |
69 | 69 | ||
70 | #define nabi_no_regargs \ | 70 | #define nabi_no_regargs \ |
71 | unsigned long __dummy0, \ | 71 | unsigned long __dummy0, \ |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 9e47cc11aa26..06f6463c24ad 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -43,6 +43,8 @@ | |||
43 | # ifdef CONFIG_MIPS32_O32 | 43 | # ifdef CONFIG_MIPS32_O32 |
44 | # define __ARCH_WANT_COMPAT_SYS_TIME | 44 | # define __ARCH_WANT_COMPAT_SYS_TIME |
45 | # endif | 45 | # endif |
46 | #define __ARCH_WANT_SYS_FORK | ||
47 | #define __ARCH_WANT_SYS_CLONE | ||
46 | 48 | ||
47 | /* whitelists for checksyscalls */ | 49 | /* whitelists for checksyscalls */ |
48 | #define __IGNORE_select | 50 | #define __IGNORE_select |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 7adab86c632c..253bd8ad7446 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -119,22 +119,6 @@ SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf, | |||
119 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); | 119 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); |
120 | } | 120 | } |
121 | 121 | ||
122 | SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid, | ||
123 | struct compat_timespec __user *, interval) | ||
124 | { | ||
125 | struct timespec t; | ||
126 | int ret; | ||
127 | mm_segment_t old_fs = get_fs(); | ||
128 | |||
129 | set_fs(KERNEL_DS); | ||
130 | ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t); | ||
131 | set_fs(old_fs); | ||
132 | if (put_user (t.tv_sec, &interval->tv_sec) || | ||
133 | __put_user(t.tv_nsec, &interval->tv_nsec)) | ||
134 | return -EFAULT; | ||
135 | return ret; | ||
136 | } | ||
137 | |||
138 | #ifdef CONFIG_SYSVIPC | 122 | #ifdef CONFIG_SYSVIPC |
139 | 123 | ||
140 | SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third, | 124 | SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third, |
@@ -295,27 +279,6 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2, | |||
295 | merge_64(len_a4, len_a5)); | 279 | merge_64(len_a4, len_a5)); |
296 | } | 280 | } |
297 | 281 | ||
298 | save_static_function(sys32_clone); | ||
299 | static int noinline __used | ||
300 | _sys32_clone(nabi_no_regargs struct pt_regs regs) | ||
301 | { | ||
302 | unsigned long clone_flags; | ||
303 | unsigned long newsp; | ||
304 | int __user *parent_tidptr, *child_tidptr; | ||
305 | |||
306 | clone_flags = regs.regs[4]; | ||
307 | newsp = regs.regs[5]; | ||
308 | if (!newsp) | ||
309 | newsp = regs.regs[29]; | ||
310 | parent_tidptr = (int __user *) regs.regs[6]; | ||
311 | |||
312 | /* Use __dummy4 instead of getting it off the stack, so that | ||
313 | syscall() works. */ | ||
314 | child_tidptr = (int __user *) __dummy4; | ||
315 | return do_fork(clone_flags, newsp, 0, | ||
316 | parent_tidptr, child_tidptr); | ||
317 | } | ||
318 | |||
319 | asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf, | 282 | asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf, |
320 | size_t len) | 283 | size_t len) |
321 | { | 284 | { |
@@ -328,10 +291,3 @@ SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, | |||
328 | return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), | 291 | return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), |
329 | dfd, pathname); | 292 | dfd, pathname); |
330 | } | 293 | } |
331 | |||
332 | SYSCALL_DEFINE6(32_futex, u32 __user *, uaddr, int, op, u32, val, | ||
333 | struct compat_timespec __user *, utime, u32 __user *, uaddr2, | ||
334 | u32, val3) | ||
335 | { | ||
336 | return compat_sys_futex(uaddr, op, val, utime, uaddr2, val3); | ||
337 | } | ||
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index a11c6f9fdd5e..a33d2ef8f273 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -156,7 +156,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
156 | *childregs = *regs; | 156 | *childregs = *regs; |
157 | childregs->regs[7] = 0; /* Clear error flag */ | 157 | childregs->regs[7] = 0; /* Clear error flag */ |
158 | childregs->regs[2] = 0; /* Child gets zero as return value */ | 158 | childregs->regs[2] = 0; /* Child gets zero as return value */ |
159 | childregs->regs[29] = usp; | 159 | if (usp) |
160 | childregs->regs[29] = usp; | ||
160 | ti->addr_limit = USER_DS; | 161 | ti->addr_limit = USER_DS; |
161 | 162 | ||
162 | p->thread.reg29 = (unsigned long) childregs; | 163 | p->thread.reg29 = (unsigned long) childregs; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index d20a4bc9ed05..80ff9422215f 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -226,7 +226,7 @@ einval: li v0, -ENOSYS | |||
226 | .macro syscalltable | 226 | .macro syscalltable |
227 | sys sys_syscall 8 /* 4000 */ | 227 | sys sys_syscall 8 /* 4000 */ |
228 | sys sys_exit 1 | 228 | sys sys_exit 1 |
229 | sys sys_fork 0 | 229 | sys __sys_fork 0 |
230 | sys sys_read 3 | 230 | sys sys_read 3 |
231 | sys sys_write 3 | 231 | sys sys_write 3 |
232 | sys sys_open 3 /* 4005 */ | 232 | sys sys_open 3 /* 4005 */ |
@@ -344,7 +344,7 @@ einval: li v0, -ENOSYS | |||
344 | sys sys_ipc 6 | 344 | sys sys_ipc 6 |
345 | sys sys_fsync 1 | 345 | sys sys_fsync 1 |
346 | sys sys_sigreturn 0 | 346 | sys sys_sigreturn 0 |
347 | sys sys_clone 0 /* 4120 */ | 347 | sys __sys_clone 6 /* 4120 */ |
348 | sys sys_setdomainname 2 | 348 | sys sys_setdomainname 2 |
349 | sys sys_newuname 1 | 349 | sys sys_newuname 1 |
350 | sys sys_ni_syscall 0 /* sys_modify_ldt */ | 350 | sys sys_ni_syscall 0 /* sys_modify_ldt */ |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index b64f642da073..9444ad9ea575 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -170,8 +170,8 @@ sys_call_table: | |||
170 | PTR sys_socketpair | 170 | PTR sys_socketpair |
171 | PTR sys_setsockopt | 171 | PTR sys_setsockopt |
172 | PTR sys_getsockopt | 172 | PTR sys_getsockopt |
173 | PTR sys_clone /* 5055 */ | 173 | PTR __sys_clone /* 5055 */ |
174 | PTR sys_fork | 174 | PTR __sys_fork |
175 | PTR sys_execve | 175 | PTR sys_execve |
176 | PTR sys_exit | 176 | PTR sys_exit |
177 | PTR sys_wait4 | 177 | PTR sys_wait4 |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index c29ac197f446..3b18a8e29215 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -117,8 +117,8 @@ EXPORT(sysn32_call_table) | |||
117 | PTR sys_mprotect /* 6010 */ | 117 | PTR sys_mprotect /* 6010 */ |
118 | PTR sys_munmap | 118 | PTR sys_munmap |
119 | PTR sys_brk | 119 | PTR sys_brk |
120 | PTR sys_32_rt_sigaction | 120 | PTR compat_sys_rt_sigaction |
121 | PTR sys_32_rt_sigprocmask | 121 | PTR compat_sys_rt_sigprocmask |
122 | PTR compat_sys_ioctl /* 6015 */ | 122 | PTR compat_sys_ioctl /* 6015 */ |
123 | PTR sys_pread64 | 123 | PTR sys_pread64 |
124 | PTR sys_pwrite64 | 124 | PTR sys_pwrite64 |
@@ -159,8 +159,8 @@ EXPORT(sysn32_call_table) | |||
159 | PTR sys_socketpair | 159 | PTR sys_socketpair |
160 | PTR compat_sys_setsockopt | 160 | PTR compat_sys_setsockopt |
161 | PTR sys_getsockopt | 161 | PTR sys_getsockopt |
162 | PTR sys_clone /* 6055 */ | 162 | PTR __sys_clone /* 6055 */ |
163 | PTR sys_fork | 163 | PTR __sys_fork |
164 | PTR compat_sys_execve | 164 | PTR compat_sys_execve |
165 | PTR sys_exit | 165 | PTR sys_exit |
166 | PTR compat_sys_wait4 | 166 | PTR compat_sys_wait4 |
@@ -229,11 +229,11 @@ EXPORT(sysn32_call_table) | |||
229 | PTR sys_getsid | 229 | PTR sys_getsid |
230 | PTR sys_capget | 230 | PTR sys_capget |
231 | PTR sys_capset | 231 | PTR sys_capset |
232 | PTR sys_32_rt_sigpending /* 6125 */ | 232 | PTR compat_sys_rt_sigpending /* 6125 */ |
233 | PTR compat_sys_rt_sigtimedwait | 233 | PTR compat_sys_rt_sigtimedwait |
234 | PTR sys_32_rt_sigqueueinfo | 234 | PTR compat_sys_rt_sigqueueinfo |
235 | PTR sysn32_rt_sigsuspend | 235 | PTR compat_sys_rt_sigsuspend |
236 | PTR sys32_sigaltstack | 236 | PTR compat_sys_sigaltstack |
237 | PTR compat_sys_utime /* 6130 */ | 237 | PTR compat_sys_utime /* 6130 */ |
238 | PTR sys_mknod | 238 | PTR sys_mknod |
239 | PTR sys_32_personality | 239 | PTR sys_32_personality |
@@ -249,7 +249,7 @@ EXPORT(sysn32_call_table) | |||
249 | PTR sys_sched_getscheduler | 249 | PTR sys_sched_getscheduler |
250 | PTR sys_sched_get_priority_max | 250 | PTR sys_sched_get_priority_max |
251 | PTR sys_sched_get_priority_min | 251 | PTR sys_sched_get_priority_min |
252 | PTR sys_32_sched_rr_get_interval /* 6145 */ | 252 | PTR compat_sys_sched_rr_get_interval /* 6145 */ |
253 | PTR sys_mlock | 253 | PTR sys_mlock |
254 | PTR sys_munlock | 254 | PTR sys_munlock |
255 | PTR sys_mlockall | 255 | PTR sys_mlockall |
@@ -298,7 +298,7 @@ EXPORT(sysn32_call_table) | |||
298 | PTR sys_fremovexattr | 298 | PTR sys_fremovexattr |
299 | PTR sys_tkill | 299 | PTR sys_tkill |
300 | PTR sys_ni_syscall | 300 | PTR sys_ni_syscall |
301 | PTR sys_32_futex | 301 | PTR compat_sys_futex |
302 | PTR compat_sys_sched_setaffinity /* 6195 */ | 302 | PTR compat_sys_sched_setaffinity /* 6195 */ |
303 | PTR compat_sys_sched_getaffinity | 303 | PTR compat_sys_sched_getaffinity |
304 | PTR sys_cacheflush | 304 | PTR sys_cacheflush |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index cf3e75e46650..063cd0d6ddd2 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -194,7 +194,7 @@ einval: li v0, -ENOSYS | |||
194 | sys_call_table: | 194 | sys_call_table: |
195 | PTR sys32_syscall /* 4000 */ | 195 | PTR sys32_syscall /* 4000 */ |
196 | PTR sys_exit | 196 | PTR sys_exit |
197 | PTR sys_fork | 197 | PTR __sys_fork |
198 | PTR sys_read | 198 | PTR sys_read |
199 | PTR sys_write | 199 | PTR sys_write |
200 | PTR compat_sys_open /* 4005 */ | 200 | PTR compat_sys_open /* 4005 */ |
@@ -312,7 +312,7 @@ sys_call_table: | |||
312 | PTR sys_32_ipc | 312 | PTR sys_32_ipc |
313 | PTR sys_fsync | 313 | PTR sys_fsync |
314 | PTR sys32_sigreturn | 314 | PTR sys32_sigreturn |
315 | PTR sys32_clone /* 4120 */ | 315 | PTR __sys_clone /* 4120 */ |
316 | PTR sys_setdomainname | 316 | PTR sys_setdomainname |
317 | PTR sys_newuname | 317 | PTR sys_newuname |
318 | PTR sys_ni_syscall /* sys_modify_ldt */ | 318 | PTR sys_ni_syscall /* sys_modify_ldt */ |
@@ -357,7 +357,7 @@ sys_call_table: | |||
357 | PTR sys_sched_yield | 357 | PTR sys_sched_yield |
358 | PTR sys_sched_get_priority_max | 358 | PTR sys_sched_get_priority_max |
359 | PTR sys_sched_get_priority_min | 359 | PTR sys_sched_get_priority_min |
360 | PTR sys_32_sched_rr_get_interval /* 4165 */ | 360 | PTR compat_sys_sched_rr_get_interval /* 4165 */ |
361 | PTR compat_sys_nanosleep | 361 | PTR compat_sys_nanosleep |
362 | PTR sys_mremap | 362 | PTR sys_mremap |
363 | PTR sys_accept | 363 | PTR sys_accept |
@@ -386,19 +386,19 @@ sys_call_table: | |||
386 | PTR sys_getresgid | 386 | PTR sys_getresgid |
387 | PTR sys_prctl | 387 | PTR sys_prctl |
388 | PTR sys32_rt_sigreturn | 388 | PTR sys32_rt_sigreturn |
389 | PTR sys_32_rt_sigaction | 389 | PTR compat_sys_rt_sigaction |
390 | PTR sys_32_rt_sigprocmask /* 4195 */ | 390 | PTR compat_sys_rt_sigprocmask /* 4195 */ |
391 | PTR sys_32_rt_sigpending | 391 | PTR compat_sys_rt_sigpending |
392 | PTR compat_sys_rt_sigtimedwait | 392 | PTR compat_sys_rt_sigtimedwait |
393 | PTR sys_32_rt_sigqueueinfo | 393 | PTR compat_sys_rt_sigqueueinfo |
394 | PTR sys32_rt_sigsuspend | 394 | PTR compat_sys_rt_sigsuspend |
395 | PTR sys_32_pread /* 4200 */ | 395 | PTR sys_32_pread /* 4200 */ |
396 | PTR sys_32_pwrite | 396 | PTR sys_32_pwrite |
397 | PTR sys_chown | 397 | PTR sys_chown |
398 | PTR sys_getcwd | 398 | PTR sys_getcwd |
399 | PTR sys_capget | 399 | PTR sys_capget |
400 | PTR sys_capset /* 4205 */ | 400 | PTR sys_capset /* 4205 */ |
401 | PTR sys32_sigaltstack | 401 | PTR compat_sys_sigaltstack |
402 | PTR sys_32_sendfile | 402 | PTR sys_32_sendfile |
403 | PTR sys_ni_syscall | 403 | PTR sys_ni_syscall |
404 | PTR sys_ni_syscall | 404 | PTR sys_ni_syscall |
@@ -430,7 +430,7 @@ sys_call_table: | |||
430 | PTR sys_fremovexattr /* 4235 */ | 430 | PTR sys_fremovexattr /* 4235 */ |
431 | PTR sys_tkill | 431 | PTR sys_tkill |
432 | PTR sys_sendfile64 | 432 | PTR sys_sendfile64 |
433 | PTR sys_32_futex | 433 | PTR compat_sys_futex |
434 | PTR compat_sys_sched_setaffinity | 434 | PTR compat_sys_sched_setaffinity |
435 | PTR compat_sys_sched_getaffinity /* 4240 */ | 435 | PTR compat_sys_sched_getaffinity /* 4240 */ |
436 | PTR compat_sys_io_setup | 436 | PTR compat_sys_io_setup |
@@ -470,7 +470,7 @@ sys_call_table: | |||
470 | PTR compat_sys_mq_notify /* 4275 */ | 470 | PTR compat_sys_mq_notify /* 4275 */ |
471 | PTR compat_sys_mq_getsetattr | 471 | PTR compat_sys_mq_getsetattr |
472 | PTR sys_ni_syscall /* sys_vserver */ | 472 | PTR sys_ni_syscall /* sys_vserver */ |
473 | PTR sys_32_waitid | 473 | PTR compat_sys_waitid |
474 | PTR sys_ni_syscall /* available, was setaltroot */ | 474 | PTR sys_ni_syscall /* available, was setaltroot */ |
475 | PTR sys_add_key /* 4280 */ | 475 | PTR sys_add_key /* 4280 */ |
476 | PTR sys_request_key | 476 | PTR sys_request_key |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 4d790d1f03d6..95b019d92f50 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -247,31 +247,12 @@ void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
247 | */ | 247 | */ |
248 | 248 | ||
249 | #ifdef CONFIG_TRAD_SIGNALS | 249 | #ifdef CONFIG_TRAD_SIGNALS |
250 | asmlinkage int sys_sigsuspend(nabi_no_regargs struct pt_regs regs) | 250 | SYSCALL_DEFINE1(sigsuspend, sigset_t __user *, uset) |
251 | { | 251 | { |
252 | sigset_t newset; | 252 | return sys_rt_sigsuspend(uset, sizeof(sigset_t)); |
253 | sigset_t __user *uset; | ||
254 | |||
255 | uset = (sigset_t __user *) regs.regs[4]; | ||
256 | if (copy_from_user(&newset, uset, sizeof(sigset_t))) | ||
257 | return -EFAULT; | ||
258 | return sigsuspend(&newset); | ||
259 | } | 253 | } |
260 | #endif | 254 | #endif |
261 | 255 | ||
262 | SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *,unewset, size_t, sigsetsize) | ||
263 | { | ||
264 | sigset_t newset; | ||
265 | |||
266 | /* XXX Don't preclude handling different sized sigset_t's. */ | ||
267 | if (sigsetsize != sizeof(sigset_t)) | ||
268 | return -EINVAL; | ||
269 | |||
270 | if (copy_from_user(&newset, unewset, sizeof(newset))) | ||
271 | return -EFAULT; | ||
272 | return sigsuspend(&newset); | ||
273 | } | ||
274 | |||
275 | #ifdef CONFIG_TRAD_SIGNALS | 256 | #ifdef CONFIG_TRAD_SIGNALS |
276 | SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, | 257 | SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, |
277 | struct sigaction __user *, oact) | 258 | struct sigaction __user *, oact) |
@@ -313,15 +294,6 @@ SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, | |||
313 | } | 294 | } |
314 | #endif | 295 | #endif |
315 | 296 | ||
316 | asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs) | ||
317 | { | ||
318 | const stack_t __user *uss = (const stack_t __user *) regs.regs[4]; | ||
319 | stack_t __user *uoss = (stack_t __user *) regs.regs[5]; | ||
320 | unsigned long usp = regs.regs[29]; | ||
321 | |||
322 | return do_sigaltstack(uss, uoss, usp); | ||
323 | } | ||
324 | |||
325 | #ifdef CONFIG_TRAD_SIGNALS | 297 | #ifdef CONFIG_TRAD_SIGNALS |
326 | asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) | 298 | asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) |
327 | { | 299 | { |
@@ -378,9 +350,8 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
378 | else if (sig) | 350 | else if (sig) |
379 | force_sig(sig, current); | 351 | force_sig(sig, current); |
380 | 352 | ||
381 | /* It is more difficult to avoid calling this function than to | 353 | if (restore_altstack(&frame->rs_uc.uc_stack)) |
382 | call it and ignore errors. */ | 354 | goto badframe; |
383 | do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]); | ||
384 | 355 | ||
385 | /* | 356 | /* |
386 | * Don't let your children do this ... | 357 | * Don't let your children do this ... |
@@ -457,12 +428,7 @@ static int setup_rt_frame(void *sig_return, struct k_sigaction *ka, | |||
457 | /* Create the ucontext. */ | 428 | /* Create the ucontext. */ |
458 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 429 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
459 | err |= __put_user(NULL, &frame->rs_uc.uc_link); | 430 | err |= __put_user(NULL, &frame->rs_uc.uc_link); |
460 | err |= __put_user((void __user *)current->sas_ss_sp, | 431 | err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); |
461 | &frame->rs_uc.uc_stack.ss_sp); | ||
462 | err |= __put_user(sas_ss_flags(regs->regs[29]), | ||
463 | &frame->rs_uc.uc_stack.ss_flags); | ||
464 | err |= __put_user(current->sas_ss_size, | ||
465 | &frame->rs_uc.uc_stack.ss_size); | ||
466 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); | 432 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); |
467 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); | 433 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); |
468 | 434 | ||
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index da1b56a39ac7..ad7c2be0c33d 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -55,23 +55,10 @@ extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user | |||
55 | typedef unsigned int __sighandler32_t; | 55 | typedef unsigned int __sighandler32_t; |
56 | typedef void (*vfptr_t)(void); | 56 | typedef void (*vfptr_t)(void); |
57 | 57 | ||
58 | struct sigaction32 { | ||
59 | unsigned int sa_flags; | ||
60 | __sighandler32_t sa_handler; | ||
61 | compat_sigset_t sa_mask; | ||
62 | }; | ||
63 | |||
64 | /* IRIX compatible stack_t */ | ||
65 | typedef struct sigaltstack32 { | ||
66 | s32 ss_sp; | ||
67 | compat_size_t ss_size; | ||
68 | int ss_flags; | ||
69 | } stack32_t; | ||
70 | |||
71 | struct ucontext32 { | 58 | struct ucontext32 { |
72 | u32 uc_flags; | 59 | u32 uc_flags; |
73 | s32 uc_link; | 60 | s32 uc_link; |
74 | stack32_t uc_stack; | 61 | compat_stack_t uc_stack; |
75 | struct sigcontext32 uc_mcontext; | 62 | struct sigcontext32 uc_mcontext; |
76 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 63 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
77 | }; | 64 | }; |
@@ -280,36 +267,13 @@ static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t __user *ubuf) | |||
280 | * Atomically swap in the new signal mask, and wait for a signal. | 267 | * Atomically swap in the new signal mask, and wait for a signal. |
281 | */ | 268 | */ |
282 | 269 | ||
283 | asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) | 270 | asmlinkage int sys32_sigsuspend(compat_sigset_t __user *uset) |
284 | { | 271 | { |
285 | compat_sigset_t __user *uset; | 272 | return compat_sys_rt_sigsuspend(uset, sizeof(compat_sigset_t)); |
286 | sigset_t newset; | ||
287 | |||
288 | uset = (compat_sigset_t __user *) regs.regs[4]; | ||
289 | if (get_sigset(&newset, uset)) | ||
290 | return -EFAULT; | ||
291 | return sigsuspend(&newset); | ||
292 | } | ||
293 | |||
294 | asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | ||
295 | { | ||
296 | compat_sigset_t __user *uset; | ||
297 | sigset_t newset; | ||
298 | size_t sigsetsize; | ||
299 | |||
300 | /* XXX Don't preclude handling different sized sigset_t's. */ | ||
301 | sigsetsize = regs.regs[5]; | ||
302 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
303 | return -EINVAL; | ||
304 | |||
305 | uset = (compat_sigset_t __user *) regs.regs[4]; | ||
306 | if (get_sigset(&newset, uset)) | ||
307 | return -EFAULT; | ||
308 | return sigsuspend(&newset); | ||
309 | } | 273 | } |
310 | 274 | ||
311 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, | 275 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct compat_sigaction __user *, act, |
312 | struct sigaction32 __user *, oact) | 276 | struct compat_sigaction __user *, oact) |
313 | { | 277 | { |
314 | struct k_sigaction new_ka, old_ka; | 278 | struct k_sigaction new_ka, old_ka; |
315 | int ret; | 279 | int ret; |
@@ -350,45 +314,6 @@ SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, | |||
350 | return ret; | 314 | return ret; |
351 | } | 315 | } |
352 | 316 | ||
353 | asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs) | ||
354 | { | ||
355 | const stack32_t __user *uss = (const stack32_t __user *) regs.regs[4]; | ||
356 | stack32_t __user *uoss = (stack32_t __user *) regs.regs[5]; | ||
357 | unsigned long usp = regs.regs[29]; | ||
358 | stack_t kss, koss; | ||
359 | int ret, err = 0; | ||
360 | mm_segment_t old_fs = get_fs(); | ||
361 | s32 sp; | ||
362 | |||
363 | if (uss) { | ||
364 | if (!access_ok(VERIFY_READ, uss, sizeof(*uss))) | ||
365 | return -EFAULT; | ||
366 | err |= __get_user(sp, &uss->ss_sp); | ||
367 | kss.ss_sp = (void __user *) (long) sp; | ||
368 | err |= __get_user(kss.ss_size, &uss->ss_size); | ||
369 | err |= __get_user(kss.ss_flags, &uss->ss_flags); | ||
370 | if (err) | ||
371 | return -EFAULT; | ||
372 | } | ||
373 | |||
374 | set_fs(KERNEL_DS); | ||
375 | ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL, | ||
376 | uoss ? (stack_t __user *)&koss : NULL, usp); | ||
377 | set_fs(old_fs); | ||
378 | |||
379 | if (!ret && uoss) { | ||
380 | if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) | ||
381 | return -EFAULT; | ||
382 | sp = (int) (unsigned long) koss.ss_sp; | ||
383 | err |= __put_user(sp, &uoss->ss_sp); | ||
384 | err |= __put_user(koss.ss_size, &uoss->ss_size); | ||
385 | err |= __put_user(koss.ss_flags, &uoss->ss_flags); | ||
386 | if (err) | ||
387 | return -EFAULT; | ||
388 | } | ||
389 | return ret; | ||
390 | } | ||
391 | |||
392 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 317 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
393 | { | 318 | { |
394 | int err; | 319 | int err; |
@@ -490,10 +415,7 @@ badframe: | |||
490 | asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 415 | asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |
491 | { | 416 | { |
492 | struct rt_sigframe32 __user *frame; | 417 | struct rt_sigframe32 __user *frame; |
493 | mm_segment_t old_fs; | ||
494 | sigset_t set; | 418 | sigset_t set; |
495 | stack_t st; | ||
496 | s32 sp; | ||
497 | int sig; | 419 | int sig; |
498 | 420 | ||
499 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; | 421 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; |
@@ -510,22 +432,9 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
510 | else if (sig) | 432 | else if (sig) |
511 | force_sig(sig, current); | 433 | force_sig(sig, current); |
512 | 434 | ||
513 | /* The ucontext contains a stack32_t, so we must convert! */ | 435 | if (compat_restore_altstack(&frame->rs_uc.uc_stack)) |
514 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) | ||
515 | goto badframe; | ||
516 | st.ss_sp = (void __user *)(long) sp; | ||
517 | if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) | ||
518 | goto badframe; | ||
519 | if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) | ||
520 | goto badframe; | 436 | goto badframe; |
521 | 437 | ||
522 | /* It is more difficult to avoid calling this function than to | ||
523 | call it and ignore errors. */ | ||
524 | old_fs = get_fs(); | ||
525 | set_fs(KERNEL_DS); | ||
526 | do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); | ||
527 | set_fs(old_fs); | ||
528 | |||
529 | /* | 438 | /* |
530 | * Don't let your children do this ... | 439 | * Don't let your children do this ... |
531 | */ | 440 | */ |
@@ -590,7 +499,6 @@ static int setup_rt_frame_32(void *sig_return, struct k_sigaction *ka, | |||
590 | { | 499 | { |
591 | struct rt_sigframe32 __user *frame; | 500 | struct rt_sigframe32 __user *frame; |
592 | int err = 0; | 501 | int err = 0; |
593 | s32 sp; | ||
594 | 502 | ||
595 | frame = get_sigframe(ka, regs, sizeof(*frame)); | 503 | frame = get_sigframe(ka, regs, sizeof(*frame)); |
596 | if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) | 504 | if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) |
@@ -602,13 +510,7 @@ static int setup_rt_frame_32(void *sig_return, struct k_sigaction *ka, | |||
602 | /* Create the ucontext. */ | 510 | /* Create the ucontext. */ |
603 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 511 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
604 | err |= __put_user(0, &frame->rs_uc.uc_link); | 512 | err |= __put_user(0, &frame->rs_uc.uc_link); |
605 | sp = (int) (long) current->sas_ss_sp; | 513 | err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); |
606 | err |= __put_user(sp, | ||
607 | &frame->rs_uc.uc_stack.ss_sp); | ||
608 | err |= __put_user(sas_ss_flags(regs->regs[29]), | ||
609 | &frame->rs_uc.uc_stack.ss_flags); | ||
610 | err |= __put_user(current->sas_ss_size, | ||
611 | &frame->rs_uc.uc_stack.ss_size); | ||
612 | err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext); | 514 | err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext); |
613 | err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); | 515 | err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); |
614 | 516 | ||
@@ -656,131 +558,6 @@ struct mips_abi mips_abi_32 = { | |||
656 | .restart = __NR_O32_restart_syscall | 558 | .restart = __NR_O32_restart_syscall |
657 | }; | 559 | }; |
658 | 560 | ||
659 | SYSCALL_DEFINE4(32_rt_sigaction, int, sig, | ||
660 | const struct sigaction32 __user *, act, | ||
661 | struct sigaction32 __user *, oact, unsigned int, sigsetsize) | ||
662 | { | ||
663 | struct k_sigaction new_sa, old_sa; | ||
664 | int ret = -EINVAL; | ||
665 | |||
666 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
667 | if (sigsetsize != sizeof(sigset_t)) | ||
668 | goto out; | ||
669 | |||
670 | if (act) { | ||
671 | s32 handler; | ||
672 | int err = 0; | ||
673 | |||
674 | if (!access_ok(VERIFY_READ, act, sizeof(*act))) | ||
675 | return -EFAULT; | ||
676 | err |= __get_user(handler, &act->sa_handler); | ||
677 | new_sa.sa.sa_handler = (void __user *)(s64)handler; | ||
678 | err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags); | ||
679 | err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask); | ||
680 | if (err) | ||
681 | return -EFAULT; | ||
682 | } | ||
683 | |||
684 | ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL); | ||
685 | |||
686 | if (!ret && oact) { | ||
687 | int err = 0; | ||
688 | |||
689 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) | ||
690 | return -EFAULT; | ||
691 | |||
692 | err |= __put_user((u32)(u64)old_sa.sa.sa_handler, | ||
693 | &oact->sa_handler); | ||
694 | err |= __put_user(old_sa.sa.sa_flags, &oact->sa_flags); | ||
695 | err |= put_sigset(&old_sa.sa.sa_mask, &oact->sa_mask); | ||
696 | if (err) | ||
697 | return -EFAULT; | ||
698 | } | ||
699 | out: | ||
700 | return ret; | ||
701 | } | ||
702 | |||
703 | SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set, | ||
704 | compat_sigset_t __user *, oset, unsigned int, sigsetsize) | ||
705 | { | ||
706 | sigset_t old_set, new_set; | ||
707 | int ret; | ||
708 | mm_segment_t old_fs = get_fs(); | ||
709 | |||
710 | if (set && get_sigset(&new_set, set)) | ||
711 | return -EFAULT; | ||
712 | |||
713 | set_fs(KERNEL_DS); | ||
714 | ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL, | ||
715 | oset ? (sigset_t __user *)&old_set : NULL, | ||
716 | sigsetsize); | ||
717 | set_fs(old_fs); | ||
718 | |||
719 | if (!ret && oset && put_sigset(&old_set, oset)) | ||
720 | return -EFAULT; | ||
721 | |||
722 | return ret; | ||
723 | } | ||
724 | |||
725 | SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset, | ||
726 | unsigned int, sigsetsize) | ||
727 | { | ||
728 | int ret; | ||
729 | sigset_t set; | ||
730 | mm_segment_t old_fs = get_fs(); | ||
731 | |||
732 | set_fs(KERNEL_DS); | ||
733 | ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize); | ||
734 | set_fs(old_fs); | ||
735 | |||
736 | if (!ret && put_sigset(&set, uset)) | ||
737 | return -EFAULT; | ||
738 | |||
739 | return ret; | ||
740 | } | ||
741 | |||
742 | SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig, | ||
743 | compat_siginfo_t __user *, uinfo) | ||
744 | { | ||
745 | siginfo_t info; | ||
746 | int ret; | ||
747 | mm_segment_t old_fs = get_fs(); | ||
748 | |||
749 | if (copy_from_user(&info, uinfo, 3*sizeof(int)) || | ||
750 | copy_from_user(info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE)) | ||
751 | return -EFAULT; | ||
752 | set_fs(KERNEL_DS); | ||
753 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info); | ||
754 | set_fs(old_fs); | ||
755 | return ret; | ||
756 | } | ||
757 | |||
758 | SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid, | ||
759 | compat_siginfo_t __user *, uinfo, int, options, | ||
760 | struct compat_rusage __user *, uru) | ||
761 | { | ||
762 | siginfo_t info; | ||
763 | struct rusage ru; | ||
764 | long ret; | ||
765 | mm_segment_t old_fs = get_fs(); | ||
766 | |||
767 | info.si_signo = 0; | ||
768 | set_fs(KERNEL_DS); | ||
769 | ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options, | ||
770 | uru ? (struct rusage __user *) &ru : NULL); | ||
771 | set_fs(old_fs); | ||
772 | |||
773 | if (ret < 0 || info.si_signo == 0) | ||
774 | return ret; | ||
775 | |||
776 | if (uru && (ret = put_compat_rusage(&ru, uru))) | ||
777 | return ret; | ||
778 | |||
779 | BUG_ON(info.si_code & __SI_MASK); | ||
780 | info.si_code |= __SI_CHLD; | ||
781 | return copy_siginfo_to_user32(uinfo, &info); | ||
782 | } | ||
783 | |||
784 | static int signal32_init(void) | 561 | static int signal32_init(void) |
785 | { | 562 | { |
786 | if (cpu_has_fpu) { | 563 | if (cpu_has_fpu) { |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 3574c145511b..5f4ef2ae6199 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -50,18 +50,10 @@ | |||
50 | extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *); | 50 | extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *); |
51 | extern int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); | 51 | extern int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); |
52 | 52 | ||
53 | |||
54 | /* IRIX compatible stack_t */ | ||
55 | typedef struct sigaltstack32 { | ||
56 | s32 ss_sp; | ||
57 | compat_size_t ss_size; | ||
58 | int ss_flags; | ||
59 | } stack32_t; | ||
60 | |||
61 | struct ucontextn32 { | 53 | struct ucontextn32 { |
62 | u32 uc_flags; | 54 | u32 uc_flags; |
63 | s32 uc_link; | 55 | s32 uc_link; |
64 | stack32_t uc_stack; | 56 | compat_stack_t uc_stack; |
65 | struct sigcontext uc_mcontext; | 57 | struct sigcontext uc_mcontext; |
66 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 58 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
67 | }; | 59 | }; |
@@ -73,34 +65,10 @@ struct rt_sigframe_n32 { | |||
73 | struct ucontextn32 rs_uc; | 65 | struct ucontextn32 rs_uc; |
74 | }; | 66 | }; |
75 | 67 | ||
76 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | ||
77 | |||
78 | asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | ||
79 | { | ||
80 | compat_sigset_t __user *unewset; | ||
81 | compat_sigset_t uset; | ||
82 | size_t sigsetsize; | ||
83 | sigset_t newset; | ||
84 | |||
85 | /* XXX Don't preclude handling different sized sigset_t's. */ | ||
86 | sigsetsize = regs.regs[5]; | ||
87 | if (sigsetsize != sizeof(sigset_t)) | ||
88 | return -EINVAL; | ||
89 | |||
90 | unewset = (compat_sigset_t __user *) regs.regs[4]; | ||
91 | if (copy_from_user(&uset, unewset, sizeof(uset))) | ||
92 | return -EFAULT; | ||
93 | sigset_from_compat(&newset, &uset); | ||
94 | return sigsuspend(&newset); | ||
95 | } | ||
96 | |||
97 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 68 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |
98 | { | 69 | { |
99 | struct rt_sigframe_n32 __user *frame; | 70 | struct rt_sigframe_n32 __user *frame; |
100 | mm_segment_t old_fs; | ||
101 | sigset_t set; | 71 | sigset_t set; |
102 | stack_t st; | ||
103 | s32 sp; | ||
104 | int sig; | 72 | int sig; |
105 | 73 | ||
106 | frame = (struct rt_sigframe_n32 __user *) regs.regs[29]; | 74 | frame = (struct rt_sigframe_n32 __user *) regs.regs[29]; |
@@ -117,23 +85,9 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
117 | else if (sig) | 85 | else if (sig) |
118 | force_sig(sig, current); | 86 | force_sig(sig, current); |
119 | 87 | ||
120 | /* The ucontext contains a stack32_t, so we must convert! */ | 88 | if (compat_restore_altstack(&frame->rs_uc.uc_stack)) |
121 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) | ||
122 | goto badframe; | ||
123 | st.ss_sp = (void __user *)(long) sp; | ||
124 | if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) | ||
125 | goto badframe; | ||
126 | if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) | ||
127 | goto badframe; | 89 | goto badframe; |
128 | 90 | ||
129 | /* It is more difficult to avoid calling this function than to | ||
130 | call it and ignore errors. */ | ||
131 | old_fs = get_fs(); | ||
132 | set_fs(KERNEL_DS); | ||
133 | do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); | ||
134 | set_fs(old_fs); | ||
135 | |||
136 | |||
137 | /* | 91 | /* |
138 | * Don't let your children do this ... | 92 | * Don't let your children do this ... |
139 | */ | 93 | */ |
@@ -153,7 +107,6 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka, | |||
153 | { | 107 | { |
154 | struct rt_sigframe_n32 __user *frame; | 108 | struct rt_sigframe_n32 __user *frame; |
155 | int err = 0; | 109 | int err = 0; |
156 | s32 sp; | ||
157 | 110 | ||
158 | frame = get_sigframe(ka, regs, sizeof(*frame)); | 111 | frame = get_sigframe(ka, regs, sizeof(*frame)); |
159 | if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) | 112 | if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) |
@@ -165,13 +118,7 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka, | |||
165 | /* Create the ucontext. */ | 118 | /* Create the ucontext. */ |
166 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 119 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
167 | err |= __put_user(0, &frame->rs_uc.uc_link); | 120 | err |= __put_user(0, &frame->rs_uc.uc_link); |
168 | sp = (int) (long) current->sas_ss_sp; | 121 | err |= __compat_save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); |
169 | err |= __put_user(sp, | ||
170 | &frame->rs_uc.uc_stack.ss_sp); | ||
171 | err |= __put_user(sas_ss_flags(regs->regs[29]), | ||
172 | &frame->rs_uc.uc_stack.ss_flags); | ||
173 | err |= __put_user(current->sas_ss_size, | ||
174 | &frame->rs_uc.uc_stack.ss_size); | ||
175 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); | 122 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); |
176 | err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); | 123 | err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); |
177 | 124 | ||
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 201cb76b4df9..b32466a1a1d2 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -46,20 +46,14 @@ | |||
46 | * argument. Historically that used to be expensive in Linux. These days | 46 | * argument. Historically that used to be expensive in Linux. These days |
47 | * the performance advantage is negligible. | 47 | * the performance advantage is negligible. |
48 | */ | 48 | */ |
49 | asmlinkage int sysm_pipe(nabi_no_regargs volatile struct pt_regs regs) | 49 | asmlinkage int sysm_pipe(void) |
50 | { | 50 | { |
51 | int fd[2]; | 51 | int fd[2]; |
52 | int error, res; | 52 | int error = do_pipe_flags(fd, 0); |
53 | 53 | if (error) | |
54 | error = do_pipe_flags(fd, 0); | 54 | return error; |
55 | if (error) { | 55 | current_pt_regs()->regs[3] = fd[1]; |
56 | res = error; | 56 | return fd[0]; |
57 | goto out; | ||
58 | } | ||
59 | regs.regs[3] = fd[1]; | ||
60 | res = fd[0]; | ||
61 | out: | ||
62 | return res; | ||
63 | } | 57 | } |
64 | 58 | ||
65 | SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, | 59 | SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, |
@@ -89,43 +83,7 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, | |||
89 | } | 83 | } |
90 | 84 | ||
91 | save_static_function(sys_fork); | 85 | save_static_function(sys_fork); |
92 | static int __used noinline | ||
93 | _sys_fork(nabi_no_regargs struct pt_regs regs) | ||
94 | { | ||
95 | return do_fork(SIGCHLD, regs.regs[29], 0, NULL, NULL); | ||
96 | } | ||
97 | |||
98 | save_static_function(sys_clone); | 86 | save_static_function(sys_clone); |
99 | static int __used noinline | ||
100 | _sys_clone(nabi_no_regargs struct pt_regs regs) | ||
101 | { | ||
102 | unsigned long clone_flags; | ||
103 | unsigned long newsp; | ||
104 | int __user *parent_tidptr, *child_tidptr; | ||
105 | |||
106 | clone_flags = regs.regs[4]; | ||
107 | newsp = regs.regs[5]; | ||
108 | if (!newsp) | ||
109 | newsp = regs.regs[29]; | ||
110 | parent_tidptr = (int __user *) regs.regs[6]; | ||
111 | #ifdef CONFIG_32BIT | ||
112 | /* We need to fetch the fifth argument off the stack. */ | ||
113 | child_tidptr = NULL; | ||
114 | if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) { | ||
115 | int __user *__user *usp = (int __user *__user *) regs.regs[29]; | ||
116 | if (regs.regs[2] == __NR_syscall) { | ||
117 | if (get_user (child_tidptr, &usp[5])) | ||
118 | return -EFAULT; | ||
119 | } | ||
120 | else if (get_user (child_tidptr, &usp[4])) | ||
121 | return -EFAULT; | ||
122 | } | ||
123 | #else | ||
124 | child_tidptr = (int __user *) regs.regs[8]; | ||
125 | #endif | ||
126 | return do_fork(clone_flags, newsp, 0, | ||
127 | parent_tidptr, child_tidptr); | ||
128 | } | ||
129 | 87 | ||
130 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) | 88 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) |
131 | { | 89 | { |
@@ -138,10 +96,10 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) | |||
138 | return 0; | 96 | return 0; |
139 | } | 97 | } |
140 | 98 | ||
141 | static inline int mips_atomic_set(struct pt_regs *regs, | 99 | static inline int mips_atomic_set(unsigned long addr, unsigned long new) |
142 | unsigned long addr, unsigned long new) | ||
143 | { | 100 | { |
144 | unsigned long old, tmp; | 101 | unsigned long old, tmp; |
102 | struct pt_regs *regs; | ||
145 | unsigned int err; | 103 | unsigned int err; |
146 | 104 | ||
147 | if (unlikely(addr & 3)) | 105 | if (unlikely(addr & 3)) |
@@ -222,6 +180,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
222 | if (unlikely(err)) | 180 | if (unlikely(err)) |
223 | return err; | 181 | return err; |
224 | 182 | ||
183 | regs = current_pt_regs(); | ||
225 | regs->regs[2] = old; | 184 | regs->regs[2] = old; |
226 | regs->regs[7] = 0; /* No error */ | 185 | regs->regs[7] = 0; /* No error */ |
227 | 186 | ||
@@ -235,22 +194,14 @@ static inline int mips_atomic_set(struct pt_regs *regs, | |||
235 | : "r" (regs)); | 194 | : "r" (regs)); |
236 | 195 | ||
237 | /* unreached. Honestly. */ | 196 | /* unreached. Honestly. */ |
238 | while (1); | 197 | unreachable(); |
239 | } | 198 | } |
240 | 199 | ||
241 | save_static_function(sys_sysmips); | 200 | SYSCALL_DEFINE3(sysmips, long, cmd, long, arg1, long, arg2) |
242 | static int __used noinline | ||
243 | _sys_sysmips(nabi_no_regargs struct pt_regs regs) | ||
244 | { | 201 | { |
245 | long cmd, arg1, arg2; | ||
246 | |||
247 | cmd = regs.regs[4]; | ||
248 | arg1 = regs.regs[5]; | ||
249 | arg2 = regs.regs[6]; | ||
250 | |||
251 | switch (cmd) { | 202 | switch (cmd) { |
252 | case MIPS_ATOMIC_SET: | 203 | case MIPS_ATOMIC_SET: |
253 | return mips_atomic_set(®s, arg1, arg2); | 204 | return mips_atomic_set(arg1, arg2); |
254 | 205 | ||
255 | case MIPS_FIXADE: | 206 | case MIPS_FIXADE: |
256 | if (arg1 & ~3) | 207 | if (arg1 & ~3) |
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index e70001cfa05b..12bf06f9abe5 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -10,6 +10,9 @@ config MN10300 | |||
10 | select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER | 10 | select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER |
11 | select GENERIC_CLOCKEVENTS | 11 | select GENERIC_CLOCKEVENTS |
12 | select MODULES_USE_ELF_RELA | 12 | select MODULES_USE_ELF_RELA |
13 | select GENERIC_SIGALTSTACK | ||
14 | select OLD_SIGSUSPEND3 | ||
15 | select OLD_SIGACTION | ||
13 | 16 | ||
14 | config AM33_2 | 17 | config AM33_2 |
15 | def_bool n | 18 | def_bool n |
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h index 288ade5ec94e..214ff5e9fe60 100644 --- a/arch/mn10300/include/asm/signal.h +++ b/arch/mn10300/include/asm/signal.h | |||
@@ -26,13 +26,6 @@ typedef struct { | |||
26 | unsigned long sig[_NSIG_WORDS]; | 26 | unsigned long sig[_NSIG_WORDS]; |
27 | } sigset_t; | 27 | } sigset_t; |
28 | 28 | ||
29 | struct old_sigaction { | ||
30 | __sighandler_t sa_handler; | ||
31 | old_sigset_t sa_mask; | ||
32 | unsigned long sa_flags; | ||
33 | __sigrestore_t sa_restorer; | ||
34 | }; | ||
35 | |||
36 | #define __ARCH_HAS_SA_RESTORER | 29 | #define __ARCH_HAS_SA_RESTORER |
37 | 30 | ||
38 | #include <asm/sigcontext.h> | 31 | #include <asm/sigcontext.h> |
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index f570b3085ef9..9dfac5cd16e6 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
@@ -32,59 +32,6 @@ | |||
32 | #define DEBUG_SIG 0 | 32 | #define DEBUG_SIG 0 |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * atomically swap in the new signal mask, and wait for a signal. | ||
36 | */ | ||
37 | asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
38 | { | ||
39 | sigset_t blocked; | ||
40 | siginitset(&blocked, mask); | ||
41 | return sigsuspend(&blocked); | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * set signal action syscall | ||
46 | */ | ||
47 | asmlinkage long sys_sigaction(int sig, | ||
48 | const struct old_sigaction __user *act, | ||
49 | struct old_sigaction __user *oact) | ||
50 | { | ||
51 | struct k_sigaction new_ka, old_ka; | ||
52 | int ret; | ||
53 | |||
54 | if (act) { | ||
55 | old_sigset_t mask; | ||
56 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || | ||
57 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
58 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
59 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
60 | __get_user(mask, &act->sa_mask)) | ||
61 | return -EFAULT; | ||
62 | siginitset(&new_ka.sa.sa_mask, mask); | ||
63 | } | ||
64 | |||
65 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
66 | |||
67 | if (!ret && oact) { | ||
68 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
69 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
70 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
71 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
72 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
73 | return -EFAULT; | ||
74 | } | ||
75 | |||
76 | return ret; | ||
77 | } | ||
78 | |||
79 | /* | ||
80 | * set alternate signal stack syscall | ||
81 | */ | ||
82 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss) | ||
83 | { | ||
84 | return do_sigaltstack(uss, uoss, current_frame()->sp); | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * do a signal return; undo the signal stack. | 35 | * do a signal return; undo the signal stack. |
89 | */ | 36 | */ |
90 | static int restore_sigcontext(struct pt_regs *regs, | 37 | static int restore_sigcontext(struct pt_regs *regs, |
@@ -193,8 +140,7 @@ asmlinkage long sys_rt_sigreturn(void) | |||
193 | if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) | 140 | if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) |
194 | goto badframe; | 141 | goto badframe; |
195 | 142 | ||
196 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) == | 143 | if (restore_altstack(&frame->uc.uc_stack)) |
197 | -EFAULT) | ||
198 | goto badframe; | 144 | goto badframe; |
199 | 145 | ||
200 | return d0; | 146 | return d0; |
@@ -359,9 +305,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
359 | /* create the ucontext. */ | 305 | /* create the ucontext. */ |
360 | if (__put_user(0, &frame->uc.uc_flags) || | 306 | if (__put_user(0, &frame->uc.uc_flags) || |
361 | __put_user(0, &frame->uc.uc_link) || | 307 | __put_user(0, &frame->uc.uc_link) || |
362 | __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || | 308 | __save_altstack(&frame->uc.uc_stack, regs->sp) || |
363 | __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags) || | ||
364 | __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size) || | ||
365 | setup_sigcontext(&frame->uc.uc_mcontext, | 309 | setup_sigcontext(&frame->uc.uc_mcontext, |
366 | &frame->fpuctx, regs, set->sig[0]) || | 310 | &frame->fpuctx, regs, set->sig[0]) || |
367 | __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) | 311 | __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) |
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 0ac66f67521f..d3632eb98a1c 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig | |||
@@ -22,6 +22,7 @@ config OPENRISC | |||
22 | select GENERIC_STRNCPY_FROM_USER | 22 | select GENERIC_STRNCPY_FROM_USER |
23 | select GENERIC_STRNLEN_USER | 23 | select GENERIC_STRNLEN_USER |
24 | select MODULES_USE_ELF_RELA | 24 | select MODULES_USE_ELF_RELA |
25 | select GENERIC_SIGALTSTACK | ||
25 | 26 | ||
26 | config MMU | 27 | config MMU |
27 | def_bool y | 28 | def_bool y |
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 5e5b30601bbf..54afd0a129fe 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S | |||
@@ -1083,10 +1083,6 @@ ENTRY(__sys_fork) | |||
1083 | l.j _fork_save_extra_regs_and_call | 1083 | l.j _fork_save_extra_regs_and_call |
1084 | l.addi r3,r1,0 | 1084 | l.addi r3,r1,0 |
1085 | 1085 | ||
1086 | ENTRY(sys_sigaltstack) | ||
1087 | l.j _sys_sigaltstack | ||
1088 | l.addi r5,r1,0 | ||
1089 | |||
1090 | ENTRY(sys_rt_sigreturn) | 1086 | ENTRY(sys_rt_sigreturn) |
1091 | l.j _sys_rt_sigreturn | 1087 | l.j _sys_rt_sigreturn |
1092 | l.addi r3,r1,0 | 1088 | l.addi r3,r1,0 |
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c index ddedc8a77861..ae167f7e081a 100644 --- a/arch/openrisc/kernel/signal.c +++ b/arch/openrisc/kernel/signal.c | |||
@@ -33,12 +33,6 @@ | |||
33 | 33 | ||
34 | #define DEBUG_SIG 0 | 34 | #define DEBUG_SIG 0 |
35 | 35 | ||
36 | asmlinkage long | ||
37 | _sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs) | ||
38 | { | ||
39 | return do_sigaltstack(uss, uoss, regs->sp); | ||
40 | } | ||
41 | |||
42 | struct rt_sigframe { | 36 | struct rt_sigframe { |
43 | struct siginfo *pinfo; | 37 | struct siginfo *pinfo; |
44 | void *puc; | 38 | void *puc; |
@@ -103,9 +97,7 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) | |||
103 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 97 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
104 | goto badframe; | 98 | goto badframe; |
105 | 99 | ||
106 | /* It is more difficult to avoid calling this function than to | 100 | if (restore_altstack(&frame->uc.uc_stack)) |
107 | call it and ignore errors. */ | ||
108 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) | ||
109 | goto badframe; | 101 | goto badframe; |
110 | 102 | ||
111 | return regs->gpr[11]; | 103 | return regs->gpr[11]; |
@@ -205,10 +197,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
205 | err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); | 197 | err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); |
206 | err |= __put_user(0, &frame->uc.uc_flags); | 198 | err |= __put_user(0, &frame->uc.uc_flags); |
207 | err |= __put_user(NULL, &frame->uc.uc_link); | 199 | err |= __put_user(NULL, &frame->uc.uc_link); |
208 | err |= __put_user((void *)current->sas_ss_sp, | 200 | err |= __save_altstack(&frame->uc.uc_stack, regs->sp); |
209 | &frame->uc.uc_stack.ss_sp); | ||
210 | err |= __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags); | ||
211 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
212 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); | 201 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); |
213 | 202 | ||
214 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 203 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index b77feffbadea..2bd407ffaebf 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -23,6 +23,11 @@ config PARISC | |||
23 | select HAVE_MOD_ARCH_SPECIFIC | 23 | select HAVE_MOD_ARCH_SPECIFIC |
24 | select MODULES_USE_ELF_RELA | 24 | select MODULES_USE_ELF_RELA |
25 | select CLONE_BACKWARDS | 25 | select CLONE_BACKWARDS |
26 | select GENERIC_SIGALTSTACK | ||
27 | select GENERIC_COMPAT_RT_SIGACTION | ||
28 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
29 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
30 | select GENERIC_COMPAT_RT_SIGPENDING | ||
26 | 31 | ||
27 | help | 32 | help |
28 | The PA-RISC microprocessor is designed by Hewlett-Packard and used | 33 | The PA-RISC microprocessor is designed by Hewlett-Packard and used |
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index bfb44247d7a7..240d153daec3 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S | |||
@@ -1748,44 +1748,6 @@ ENTRY(sys_rt_sigreturn_wrapper) | |||
1748 | LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */ | 1748 | LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */ |
1749 | ENDPROC(sys_rt_sigreturn_wrapper) | 1749 | ENDPROC(sys_rt_sigreturn_wrapper) |
1750 | 1750 | ||
1751 | ENTRY(sys_sigaltstack_wrapper) | ||
1752 | /* Get the user stack pointer */ | ||
1753 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | ||
1754 | ldo TASK_REGS(%r1),%r24 /* get pt regs */ | ||
1755 | LDREG TASK_PT_GR30(%r24),%r24 | ||
1756 | STREG %r2, -RP_OFFSET(%r30) | ||
1757 | #ifdef CONFIG_64BIT | ||
1758 | ldo FRAME_SIZE(%r30), %r30 | ||
1759 | BL do_sigaltstack,%r2 | ||
1760 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
1761 | #else | ||
1762 | BL do_sigaltstack,%r2 | ||
1763 | ldo FRAME_SIZE(%r30), %r30 | ||
1764 | #endif | ||
1765 | |||
1766 | ldo -FRAME_SIZE(%r30), %r30 | ||
1767 | LDREG -RP_OFFSET(%r30), %r2 | ||
1768 | bv %r0(%r2) | ||
1769 | nop | ||
1770 | ENDPROC(sys_sigaltstack_wrapper) | ||
1771 | |||
1772 | #ifdef CONFIG_64BIT | ||
1773 | ENTRY(sys32_sigaltstack_wrapper) | ||
1774 | /* Get the user stack pointer */ | ||
1775 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24 | ||
1776 | LDREG TASK_PT_GR30(%r24),%r24 | ||
1777 | STREG %r2, -RP_OFFSET(%r30) | ||
1778 | ldo FRAME_SIZE(%r30), %r30 | ||
1779 | BL do_sigaltstack32,%r2 | ||
1780 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
1781 | |||
1782 | ldo -FRAME_SIZE(%r30), %r30 | ||
1783 | LDREG -RP_OFFSET(%r30), %r2 | ||
1784 | bv %r0(%r2) | ||
1785 | nop | ||
1786 | ENDPROC(sys32_sigaltstack_wrapper) | ||
1787 | #endif | ||
1788 | |||
1789 | ENTRY(syscall_exit) | 1751 | ENTRY(syscall_exit) |
1790 | /* NOTE: HP-UX syscalls also come through here | 1752 | /* NOTE: HP-UX syscalls also come through here |
1791 | * after hpux_syscall_exit fixes up return | 1753 | * after hpux_syscall_exit fixes up return |
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 537996955998..64d315f6d2a4 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c | |||
@@ -143,7 +143,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) | |||
143 | goto give_sigsegv; | 143 | goto give_sigsegv; |
144 | DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n", | 144 | DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n", |
145 | usp, &compat_frame->uc.uc_stack); | 145 | usp, &compat_frame->uc.uc_stack); |
146 | if (do_sigaltstack32(&compat_frame->uc.uc_stack, NULL, usp) == -EFAULT) | 146 | if (compat_restore_altstack(&compat_frame->uc.uc_stack)) |
147 | goto give_sigsegv; | 147 | goto give_sigsegv; |
148 | } else | 148 | } else |
149 | #endif | 149 | #endif |
@@ -154,7 +154,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) | |||
154 | goto give_sigsegv; | 154 | goto give_sigsegv; |
155 | DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n", | 155 | DBG(1,"sys_rt_sigreturn: usp %#08lx stack 0x%p\n", |
156 | usp, &frame->uc.uc_stack); | 156 | usp, &frame->uc.uc_stack); |
157 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, usp) == -EFAULT) | 157 | if (restore_altstack(&frame->uc.uc_stack)) |
158 | goto give_sigsegv; | 158 | goto give_sigsegv; |
159 | } | 159 | } |
160 | 160 | ||
@@ -260,15 +260,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
260 | if (is_compat_task()) { | 260 | if (is_compat_task()) { |
261 | DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info); | 261 | DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info); |
262 | err |= copy_siginfo_to_user32(&compat_frame->info, info); | 262 | err |= copy_siginfo_to_user32(&compat_frame->info, info); |
263 | DBG(1,"SETUP_RT_FRAME: 1\n"); | 263 | err |= __compat_save_altstack( &compat_frame->uc.uc_stack, regs->gr[30]); |
264 | compat_val = (compat_int_t)current->sas_ss_sp; | ||
265 | err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_sp); | ||
266 | DBG(1,"SETUP_RT_FRAME: 2\n"); | ||
267 | compat_val = (compat_int_t)current->sas_ss_size; | ||
268 | err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_size); | ||
269 | DBG(1,"SETUP_RT_FRAME: 3\n"); | ||
270 | compat_val = sas_ss_flags(regs->gr[30]); | ||
271 | err |= __put_user(compat_val, &compat_frame->uc.uc_stack.ss_flags); | ||
272 | DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &compat_frame->uc); | 264 | DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &compat_frame->uc); |
273 | DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &compat_frame->uc.uc_mcontext); | 265 | DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &compat_frame->uc.uc_mcontext); |
274 | err |= setup_sigcontext32(&compat_frame->uc.uc_mcontext, | 266 | err |= setup_sigcontext32(&compat_frame->uc.uc_mcontext, |
@@ -280,10 +272,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
280 | { | 272 | { |
281 | DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &frame->info); | 273 | DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &frame->info); |
282 | err |= copy_siginfo_to_user(&frame->info, info); | 274 | err |= copy_siginfo_to_user(&frame->info, info); |
283 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 275 | err |= __save_altstack(&frame->uc.uc_stack, regs->gr[30]); |
284 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
285 | err |= __put_user(sas_ss_flags(regs->gr[30]), | ||
286 | &frame->uc.uc_stack.ss_flags); | ||
287 | DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &frame->uc); | 276 | DBG(1,"setup_rt_frame: frame->uc = 0x%p\n", &frame->uc); |
288 | DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &frame->uc.uc_mcontext); | 277 | DBG(1,"setup_rt_frame: frame->uc.uc_mcontext = 0x%p\n", &frame->uc.uc_mcontext); |
289 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, in_syscall); | 278 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, in_syscall); |
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c index 5dede04f2f3e..33eca1b04926 100644 --- a/arch/parisc/kernel/signal32.c +++ b/arch/parisc/kernel/signal32.c | |||
@@ -60,129 +60,6 @@ sigset_64to32(compat_sigset_t *s32, sigset_t *s64) | |||
60 | s32->sig[1] = (s64->sig[0] >> 32) & 0xffffffffUL; | 60 | s32->sig[1] = (s64->sig[0] >> 32) & 0xffffffffUL; |
61 | } | 61 | } |
62 | 62 | ||
63 | static int | ||
64 | put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | ||
65 | { | ||
66 | compat_sigset_t s; | ||
67 | |||
68 | if (sz != sizeof *set) | ||
69 | return -EINVAL; | ||
70 | sigset_64to32(&s, set); | ||
71 | |||
72 | return copy_to_user(up, &s, sizeof s); | ||
73 | } | ||
74 | |||
75 | static int | ||
76 | get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | ||
77 | { | ||
78 | compat_sigset_t s; | ||
79 | int r; | ||
80 | |||
81 | if (sz != sizeof *set) | ||
82 | return -EINVAL; | ||
83 | |||
84 | if ((r = copy_from_user(&s, up, sz)) == 0) { | ||
85 | sigset_32to64(set, &s); | ||
86 | } | ||
87 | |||
88 | return r; | ||
89 | } | ||
90 | |||
91 | int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t __user *oset, | ||
92 | unsigned int sigsetsize) | ||
93 | { | ||
94 | sigset_t old_set, new_set; | ||
95 | int ret; | ||
96 | |||
97 | if (set && get_sigset32(set, &new_set, sigsetsize)) | ||
98 | return -EFAULT; | ||
99 | |||
100 | KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL, | ||
101 | oset ? (sigset_t __user *)&old_set : NULL, sigsetsize); | ||
102 | |||
103 | if (!ret && oset && put_sigset32(oset, &old_set, sigsetsize)) | ||
104 | return -EFAULT; | ||
105 | |||
106 | return ret; | ||
107 | } | ||
108 | |||
109 | |||
110 | int sys32_rt_sigpending(compat_sigset_t __user *uset, unsigned int sigsetsize) | ||
111 | { | ||
112 | int ret; | ||
113 | sigset_t set; | ||
114 | |||
115 | KERNEL_SYSCALL(ret, sys_rt_sigpending, (sigset_t __user *)&set, sigsetsize); | ||
116 | |||
117 | if (!ret && put_sigset32(uset, &set, sigsetsize)) | ||
118 | return -EFAULT; | ||
119 | |||
120 | return ret; | ||
121 | } | ||
122 | |||
123 | long | ||
124 | sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, struct sigaction32 __user *oact, | ||
125 | size_t sigsetsize) | ||
126 | { | ||
127 | struct k_sigaction32 new_sa32, old_sa32; | ||
128 | struct k_sigaction new_sa, old_sa; | ||
129 | int ret = -EINVAL; | ||
130 | |||
131 | if (act) { | ||
132 | if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa)) | ||
133 | return -EFAULT; | ||
134 | new_sa.sa.sa_handler = (__sighandler_t)(unsigned long)new_sa32.sa.sa_handler; | ||
135 | new_sa.sa.sa_flags = new_sa32.sa.sa_flags; | ||
136 | sigset_32to64(&new_sa.sa.sa_mask, &new_sa32.sa.sa_mask); | ||
137 | } | ||
138 | |||
139 | ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL); | ||
140 | |||
141 | if (!ret && oact) { | ||
142 | sigset_64to32(&old_sa32.sa.sa_mask, &old_sa.sa.sa_mask); | ||
143 | old_sa32.sa.sa_flags = old_sa.sa.sa_flags; | ||
144 | old_sa32.sa.sa_handler = (__sighandler_t32)(unsigned long)old_sa.sa.sa_handler; | ||
145 | if (copy_to_user(oact, &old_sa32.sa, sizeof old_sa32.sa)) | ||
146 | return -EFAULT; | ||
147 | } | ||
148 | return ret; | ||
149 | } | ||
150 | |||
151 | int | ||
152 | do_sigaltstack32 (const compat_stack_t __user *uss32, compat_stack_t __user *uoss32, unsigned long sp) | ||
153 | { | ||
154 | compat_stack_t ss32, oss32; | ||
155 | stack_t ss, oss; | ||
156 | stack_t *ssp = NULL, *ossp = NULL; | ||
157 | int ret; | ||
158 | |||
159 | if (uss32) { | ||
160 | if (copy_from_user(&ss32, uss32, sizeof ss32)) | ||
161 | return -EFAULT; | ||
162 | |||
163 | ss.ss_sp = (void __user *)(unsigned long)ss32.ss_sp; | ||
164 | ss.ss_flags = ss32.ss_flags; | ||
165 | ss.ss_size = ss32.ss_size; | ||
166 | |||
167 | ssp = &ss; | ||
168 | } | ||
169 | |||
170 | if (uoss32) | ||
171 | ossp = &oss; | ||
172 | |||
173 | KERNEL_SYSCALL(ret, do_sigaltstack, (const stack_t __user *)ssp, (stack_t __user *)ossp, sp); | ||
174 | |||
175 | if (!ret && uoss32) { | ||
176 | oss32.ss_sp = (unsigned int)(unsigned long)oss.ss_sp; | ||
177 | oss32.ss_flags = oss.ss_flags; | ||
178 | oss32.ss_size = oss.ss_size; | ||
179 | if (copy_to_user(uoss32, &oss32, sizeof *uoss32)) | ||
180 | return -EFAULT; | ||
181 | } | ||
182 | |||
183 | return ret; | ||
184 | } | ||
185 | |||
186 | long | 63 | long |
187 | restore_sigcontext32(struct compat_sigcontext __user *sc, struct compat_regfile __user * rf, | 64 | restore_sigcontext32(struct compat_sigcontext __user *sc, struct compat_regfile __user * rf, |
188 | struct pt_regs *regs) | 65 | struct pt_regs *regs) |
@@ -499,22 +376,3 @@ copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from) | |||
499 | } | 376 | } |
500 | return err; | 377 | return err; |
501 | } | 378 | } |
502 | |||
503 | asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig, | ||
504 | struct compat_siginfo __user *uinfo) | ||
505 | { | ||
506 | siginfo_t info; | ||
507 | |||
508 | if (copy_siginfo_from_user32(&info, uinfo)) | ||
509 | return -EFAULT; | ||
510 | |||
511 | /* Not even root can pretend to send signals from the kernel. | ||
512 | Nor can they impersonate a kill(), which adds source info. */ | ||
513 | if (info.si_code >= 0) | ||
514 | return -EPERM; | ||
515 | info.si_signo = sig; | ||
516 | |||
517 | /* POSIX.1b doesn't mention process groups. */ | ||
518 | return kill_proc_info(sig, &info, pid); | ||
519 | } | ||
520 | |||
diff --git a/arch/parisc/kernel/signal32.h b/arch/parisc/kernel/signal32.h index 08a88b5349a2..72ab41a51f32 100644 --- a/arch/parisc/kernel/signal32.h +++ b/arch/parisc/kernel/signal32.h | |||
@@ -21,23 +21,6 @@ | |||
21 | 21 | ||
22 | #include <linux/compat.h> | 22 | #include <linux/compat.h> |
23 | 23 | ||
24 | typedef compat_uptr_t compat_sighandler_t; | ||
25 | |||
26 | typedef struct compat_sigaltstack { | ||
27 | compat_uptr_t ss_sp; | ||
28 | compat_int_t ss_flags; | ||
29 | compat_size_t ss_size; | ||
30 | } compat_stack_t; | ||
31 | |||
32 | /* Most things should be clean enough to redefine this at will, if care | ||
33 | is taken to make libc match. */ | ||
34 | |||
35 | struct compat_sigaction { | ||
36 | compat_sighandler_t sa_handler; | ||
37 | compat_uint_t sa_flags; | ||
38 | compat_sigset_t sa_mask; /* mask last for extensibility */ | ||
39 | }; | ||
40 | |||
41 | /* 32-bit ucontext as seen from an 64-bit kernel */ | 24 | /* 32-bit ucontext as seen from an 64-bit kernel */ |
42 | struct compat_ucontext { | 25 | struct compat_ucontext { |
43 | compat_uint_t uc_flags; | 26 | compat_uint_t uc_flags; |
@@ -51,10 +34,6 @@ struct compat_ucontext { | |||
51 | 34 | ||
52 | /* ELF32 signal handling */ | 35 | /* ELF32 signal handling */ |
53 | 36 | ||
54 | struct k_sigaction32 { | ||
55 | struct compat_sigaction sa; | ||
56 | }; | ||
57 | |||
58 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); | 37 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); |
59 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); | 38 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); |
60 | 39 | ||
@@ -102,8 +81,6 @@ struct compat_rt_sigframe { | |||
102 | 81 | ||
103 | void sigset_32to64(sigset_t *s64, compat_sigset_t *s32); | 82 | void sigset_32to64(sigset_t *s64, compat_sigset_t *s32); |
104 | void sigset_64to32(compat_sigset_t *s32, sigset_t *s64); | 83 | void sigset_64to32(compat_sigset_t *s32, sigset_t *s64); |
105 | int do_sigaltstack32 (const compat_stack_t __user *uss32, | ||
106 | compat_stack_t __user *uoss32, unsigned long sp); | ||
107 | long restore_sigcontext32(struct compat_sigcontext __user *sc, | 84 | long restore_sigcontext32(struct compat_sigcontext __user *sc, |
108 | struct compat_regfile __user *rf, | 85 | struct compat_regfile __user *rf, |
109 | struct pt_regs *regs); | 86 | struct pt_regs *regs); |
diff --git a/arch/parisc/kernel/sys32.h b/arch/parisc/kernel/sys32.h index 06c2090cfaba..60dd470f39f8 100644 --- a/arch/parisc/kernel/sys32.h +++ b/arch/parisc/kernel/sys32.h | |||
@@ -33,16 +33,4 @@ | |||
33 | set_fs (old_fs); \ | 33 | set_fs (old_fs); \ |
34 | } | 34 | } |
35 | 35 | ||
36 | #ifdef CONFIG_COMPAT | ||
37 | |||
38 | typedef __u32 __sighandler_t32; | ||
39 | |||
40 | struct sigaction32 { | ||
41 | __sighandler_t32 sa_handler; | ||
42 | unsigned int sa_flags; | ||
43 | compat_sigset_t sa_mask; /* mask last for extensibility */ | ||
44 | }; | ||
45 | |||
46 | #endif | ||
47 | |||
48 | #endif | 36 | #endif |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 9cfdaa19ab63..9b6a376cb12b 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
@@ -61,18 +61,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | |||
61 | return -ENOSYS; | 61 | return -ENOSYS; |
62 | } | 62 | } |
63 | 63 | ||
64 | asmlinkage long sys32_sched_rr_get_interval(pid_t pid, | ||
65 | struct compat_timespec __user *interval) | ||
66 | { | ||
67 | struct timespec t; | ||
68 | int ret; | ||
69 | |||
70 | KERNEL_SYSCALL(ret, sys_sched_rr_get_interval, pid, (struct timespec __user *)&t); | ||
71 | if (put_compat_timespec(&t, interval)) | ||
72 | return -EFAULT; | ||
73 | return ret; | ||
74 | } | ||
75 | |||
76 | struct msgbuf32 { | 64 | struct msgbuf32 { |
77 | int mtype; | 65 | int mtype; |
78 | char mtext[1]; | 66 | char mtext[1]; |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 54d950b067b7..dd52c23c0dcd 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -250,12 +250,12 @@ | |||
250 | /* These 2 would've worked if someone had defined struct timespec | 250 | /* These 2 would've worked if someone had defined struct timespec |
251 | * carefully, like timeval for example (which is about the same). | 251 | * carefully, like timeval for example (which is about the same). |
252 | * Unfortunately it contains a long :-( */ | 252 | * Unfortunately it contains a long :-( */ |
253 | ENTRY_DIFF(sched_rr_get_interval) | 253 | ENTRY_COMP(sched_rr_get_interval) |
254 | ENTRY_COMP(nanosleep) | 254 | ENTRY_COMP(nanosleep) |
255 | ENTRY_SAME(mremap) | 255 | ENTRY_SAME(mremap) |
256 | ENTRY_SAME(setresuid) | 256 | ENTRY_SAME(setresuid) |
257 | ENTRY_SAME(getresuid) /* 165 */ | 257 | ENTRY_SAME(getresuid) /* 165 */ |
258 | ENTRY_DIFF(sigaltstack_wrapper) | 258 | ENTRY_COMP(sigaltstack) |
259 | ENTRY_SAME(ni_syscall) /* query_module */ | 259 | ENTRY_SAME(ni_syscall) /* query_module */ |
260 | ENTRY_SAME(poll) | 260 | ENTRY_SAME(poll) |
261 | /* structs contain pointers and an in_addr... */ | 261 | /* structs contain pointers and an in_addr... */ |
@@ -265,9 +265,9 @@ | |||
265 | ENTRY_SAME(prctl) | 265 | ENTRY_SAME(prctl) |
266 | /* signals need a careful review */ | 266 | /* signals need a careful review */ |
267 | ENTRY_SAME(rt_sigreturn_wrapper) | 267 | ENTRY_SAME(rt_sigreturn_wrapper) |
268 | ENTRY_DIFF(rt_sigaction) | 268 | ENTRY_COMP(rt_sigaction) |
269 | ENTRY_DIFF(rt_sigprocmask) /* 175 */ | 269 | ENTRY_COMP(rt_sigprocmask) /* 175 */ |
270 | ENTRY_DIFF(rt_sigpending) | 270 | ENTRY_COMP(rt_sigpending) |
271 | ENTRY_COMP(rt_sigtimedwait) | 271 | ENTRY_COMP(rt_sigtimedwait) |
272 | /* even though the struct siginfo_t is different, it appears like | 272 | /* even though the struct siginfo_t is different, it appears like |
273 | * all the paths use values which should be same wide and narrow. | 273 | * all the paths use values which should be same wide and narrow. |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 17903f1f356b..ec89a7b11f7b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -144,6 +144,13 @@ config PPC | |||
144 | select HAVE_MOD_ARCH_SPECIFIC | 144 | select HAVE_MOD_ARCH_SPECIFIC |
145 | select MODULES_USE_ELF_RELA | 145 | select MODULES_USE_ELF_RELA |
146 | select CLONE_BACKWARDS | 146 | select CLONE_BACKWARDS |
147 | select GENERIC_SIGALTSTACK | ||
148 | select GENERIC_COMPAT_RT_SIGACTION | ||
149 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
150 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
151 | select GENERIC_COMPAT_RT_SIGPENDING | ||
152 | select OLD_SIGSUSPEND | ||
153 | select OLD_SIGACTION if PPC32 | ||
147 | 154 | ||
148 | config EARLY_PRINTK | 155 | config EARLY_PRINTK |
149 | bool | 156 | bool |
@@ -154,6 +161,7 @@ config COMPAT | |||
154 | default y if PPC64 | 161 | default y if PPC64 |
155 | select COMPAT_BINFMT_ELF | 162 | select COMPAT_BINFMT_ELF |
156 | select ARCH_WANT_OLD_COMPAT_IPC | 163 | select ARCH_WANT_OLD_COMPAT_IPC |
164 | select COMPAT_OLD_SIGACTION | ||
157 | 165 | ||
158 | config SYSVIPC_COMPAT | 166 | config SYSVIPC_COMPAT |
159 | bool | 167 | bool |
diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index 6949c42ffac2..23be8f1e7e64 100644 --- a/arch/powerpc/include/asm/syscalls.h +++ b/arch/powerpc/include/asm/syscalls.h | |||
@@ -5,9 +5,7 @@ | |||
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <asm/signal.h> | ||
9 | 8 | ||
10 | struct pt_regs; | ||
11 | struct rtas_args; | 9 | struct rtas_args; |
12 | 10 | ||
13 | asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, | 11 | asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, |
@@ -16,15 +14,8 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, | |||
16 | asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, | 14 | asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, |
17 | unsigned long prot, unsigned long flags, | 15 | unsigned long prot, unsigned long flags, |
18 | unsigned long fd, unsigned long pgoff); | 16 | unsigned long fd, unsigned long pgoff); |
19 | asmlinkage long sys_pipe(int __user *fildes); | ||
20 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | ||
21 | asmlinkage long ppc64_personality(unsigned long personality); | 17 | asmlinkage long ppc64_personality(unsigned long personality); |
22 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); | 18 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); |
23 | asmlinkage time_t sys64_time(time_t __user * tloc); | ||
24 | |||
25 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, | ||
26 | stack_t __user *uoss, unsigned long r5, unsigned long r6, | ||
27 | unsigned long r7, unsigned long r8, struct pt_regs *regs); | ||
28 | 19 | ||
29 | #endif /* __KERNEL__ */ | 20 | #endif /* __KERNEL__ */ |
30 | #endif /* __ASM_POWERPC_SYSCALLS_H */ | 21 | #endif /* __ASM_POWERPC_SYSCALLS_H */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 97909d3b1d7b..d906f33441c6 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -10,8 +10,8 @@ SYSCALL_SPU(read) | |||
10 | SYSCALL_SPU(write) | 10 | SYSCALL_SPU(write) |
11 | COMPAT_SYS_SPU(open) | 11 | COMPAT_SYS_SPU(open) |
12 | SYSCALL_SPU(close) | 12 | SYSCALL_SPU(close) |
13 | COMPAT_SYS_SPU(waitpid) | 13 | SYSCALL_SPU(waitpid) |
14 | COMPAT_SYS_SPU(creat) | 14 | SYSCALL_SPU(creat) |
15 | SYSCALL_SPU(link) | 15 | SYSCALL_SPU(link) |
16 | SYSCALL_SPU(unlink) | 16 | SYSCALL_SPU(unlink) |
17 | COMPAT_SYS(execve) | 17 | COMPAT_SYS(execve) |
@@ -36,13 +36,13 @@ SYSCALL(pause) | |||
36 | COMPAT_SYS(utime) | 36 | COMPAT_SYS(utime) |
37 | SYSCALL(ni_syscall) | 37 | SYSCALL(ni_syscall) |
38 | SYSCALL(ni_syscall) | 38 | SYSCALL(ni_syscall) |
39 | COMPAT_SYS_SPU(access) | 39 | SYSCALL_SPU(access) |
40 | COMPAT_SYS_SPU(nice) | 40 | SYSCALL_SPU(nice) |
41 | SYSCALL(ni_syscall) | 41 | SYSCALL(ni_syscall) |
42 | SYSCALL_SPU(sync) | 42 | SYSCALL_SPU(sync) |
43 | COMPAT_SYS_SPU(kill) | 43 | SYSCALL_SPU(kill) |
44 | SYSCALL_SPU(rename) | 44 | SYSCALL_SPU(rename) |
45 | COMPAT_SYS_SPU(mkdir) | 45 | SYSCALL_SPU(mkdir) |
46 | SYSCALL_SPU(rmdir) | 46 | SYSCALL_SPU(rmdir) |
47 | SYSCALL_SPU(dup) | 47 | SYSCALL_SPU(dup) |
48 | SYSCALL_SPU(pipe) | 48 | SYSCALL_SPU(pipe) |
@@ -60,10 +60,10 @@ SYSCALL(ni_syscall) | |||
60 | COMPAT_SYS_SPU(ioctl) | 60 | COMPAT_SYS_SPU(ioctl) |
61 | COMPAT_SYS_SPU(fcntl) | 61 | COMPAT_SYS_SPU(fcntl) |
62 | SYSCALL(ni_syscall) | 62 | SYSCALL(ni_syscall) |
63 | COMPAT_SYS_SPU(setpgid) | 63 | SYSCALL_SPU(setpgid) |
64 | SYSCALL(ni_syscall) | 64 | SYSCALL(ni_syscall) |
65 | SYSX(sys_ni_syscall,sys_olduname, sys_olduname) | 65 | SYSX(sys_ni_syscall,sys_olduname, sys_olduname) |
66 | COMPAT_SYS_SPU(umask) | 66 | SYSCALL_SPU(umask) |
67 | SYSCALL_SPU(chroot) | 67 | SYSCALL_SPU(chroot) |
68 | COMPAT_SYS(ustat) | 68 | COMPAT_SYS(ustat) |
69 | SYSCALL_SPU(dup2) | 69 | SYSCALL_SPU(dup2) |
@@ -72,23 +72,24 @@ SYSCALL_SPU(getpgrp) | |||
72 | SYSCALL_SPU(setsid) | 72 | SYSCALL_SPU(setsid) |
73 | SYS32ONLY(sigaction) | 73 | SYS32ONLY(sigaction) |
74 | SYSCALL_SPU(sgetmask) | 74 | SYSCALL_SPU(sgetmask) |
75 | COMPAT_SYS_SPU(ssetmask) | 75 | SYSCALL_SPU(ssetmask) |
76 | SYSCALL_SPU(setreuid) | 76 | SYSCALL_SPU(setreuid) |
77 | SYSCALL_SPU(setregid) | 77 | SYSCALL_SPU(setregid) |
78 | #define compat_sys_sigsuspend sys_sigsuspend | ||
78 | SYS32ONLY(sigsuspend) | 79 | SYS32ONLY(sigsuspend) |
79 | COMPAT_SYS(sigpending) | 80 | COMPAT_SYS(sigpending) |
80 | COMPAT_SYS_SPU(sethostname) | 81 | SYSCALL_SPU(sethostname) |
81 | COMPAT_SYS_SPU(setrlimit) | 82 | COMPAT_SYS_SPU(setrlimit) |
82 | COMPAT_SYS(old_getrlimit) | 83 | COMPAT_SYS(old_getrlimit) |
83 | COMPAT_SYS_SPU(getrusage) | 84 | COMPAT_SYS_SPU(getrusage) |
84 | COMPAT_SYS_SPU(gettimeofday) | 85 | COMPAT_SYS_SPU(gettimeofday) |
85 | COMPAT_SYS_SPU(settimeofday) | 86 | COMPAT_SYS_SPU(settimeofday) |
86 | COMPAT_SYS_SPU(getgroups) | 87 | SYSCALL_SPU(getgroups) |
87 | COMPAT_SYS_SPU(setgroups) | 88 | SYSCALL_SPU(setgroups) |
88 | SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select) | 89 | SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select) |
89 | SYSCALL_SPU(symlink) | 90 | SYSCALL_SPU(symlink) |
90 | OLDSYS(lstat) | 91 | OLDSYS(lstat) |
91 | COMPAT_SYS_SPU(readlink) | 92 | SYSCALL_SPU(readlink) |
92 | SYSCALL(uselib) | 93 | SYSCALL(uselib) |
93 | SYSCALL(swapon) | 94 | SYSCALL(swapon) |
94 | SYSCALL(reboot) | 95 | SYSCALL(reboot) |
@@ -99,14 +100,14 @@ COMPAT_SYS_SPU(truncate) | |||
99 | COMPAT_SYS_SPU(ftruncate) | 100 | COMPAT_SYS_SPU(ftruncate) |
100 | SYSCALL_SPU(fchmod) | 101 | SYSCALL_SPU(fchmod) |
101 | SYSCALL_SPU(fchown) | 102 | SYSCALL_SPU(fchown) |
102 | COMPAT_SYS_SPU(getpriority) | 103 | SYSCALL_SPU(getpriority) |
103 | COMPAT_SYS_SPU(setpriority) | 104 | SYSCALL_SPU(setpriority) |
104 | SYSCALL(ni_syscall) | 105 | SYSCALL(ni_syscall) |
105 | COMPAT_SYS(statfs) | 106 | COMPAT_SYS(statfs) |
106 | COMPAT_SYS(fstatfs) | 107 | COMPAT_SYS(fstatfs) |
107 | SYSCALL(ni_syscall) | 108 | SYSCALL(ni_syscall) |
108 | COMPAT_SYS_SPU(socketcall) | 109 | COMPAT_SYS_SPU(socketcall) |
109 | COMPAT_SYS_SPU(syslog) | 110 | SYSCALL_SPU(syslog) |
110 | COMPAT_SYS_SPU(setitimer) | 111 | COMPAT_SYS_SPU(setitimer) |
111 | COMPAT_SYS_SPU(getitimer) | 112 | COMPAT_SYS_SPU(getitimer) |
112 | COMPAT_SYS_SPU(newstat) | 113 | COMPAT_SYS_SPU(newstat) |
@@ -124,7 +125,7 @@ COMPAT_SYS(ipc) | |||
124 | SYSCALL_SPU(fsync) | 125 | SYSCALL_SPU(fsync) |
125 | SYS32ONLY(sigreturn) | 126 | SYS32ONLY(sigreturn) |
126 | PPC_SYS(clone) | 127 | PPC_SYS(clone) |
127 | COMPAT_SYS_SPU(setdomainname) | 128 | SYSCALL_SPU(setdomainname) |
128 | SYSCALL_SPU(newuname) | 129 | SYSCALL_SPU(newuname) |
129 | SYSCALL(ni_syscall) | 130 | SYSCALL(ni_syscall) |
130 | COMPAT_SYS_SPU(adjtimex) | 131 | COMPAT_SYS_SPU(adjtimex) |
@@ -135,10 +136,10 @@ SYSCALL(init_module) | |||
135 | SYSCALL(delete_module) | 136 | SYSCALL(delete_module) |
136 | SYSCALL(ni_syscall) | 137 | SYSCALL(ni_syscall) |
137 | SYSCALL(quotactl) | 138 | SYSCALL(quotactl) |
138 | COMPAT_SYS_SPU(getpgid) | 139 | SYSCALL_SPU(getpgid) |
139 | SYSCALL_SPU(fchdir) | 140 | SYSCALL_SPU(fchdir) |
140 | SYSCALL_SPU(bdflush) | 141 | SYSCALL_SPU(bdflush) |
141 | COMPAT_SYS(sysfs) | 142 | SYSCALL_SPU(sysfs) |
142 | SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality) | 143 | SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality) |
143 | SYSCALL(ni_syscall) | 144 | SYSCALL(ni_syscall) |
144 | SYSCALL_SPU(setfsuid) | 145 | SYSCALL_SPU(setfsuid) |
@@ -150,21 +151,21 @@ SYSCALL_SPU(flock) | |||
150 | SYSCALL_SPU(msync) | 151 | SYSCALL_SPU(msync) |
151 | COMPAT_SYS_SPU(readv) | 152 | COMPAT_SYS_SPU(readv) |
152 | COMPAT_SYS_SPU(writev) | 153 | COMPAT_SYS_SPU(writev) |
153 | COMPAT_SYS_SPU(getsid) | 154 | SYSCALL_SPU(getsid) |
154 | SYSCALL_SPU(fdatasync) | 155 | SYSCALL_SPU(fdatasync) |
155 | COMPAT_SYS(sysctl) | 156 | COMPAT_SYS(sysctl) |
156 | SYSCALL_SPU(mlock) | 157 | SYSCALL_SPU(mlock) |
157 | SYSCALL_SPU(munlock) | 158 | SYSCALL_SPU(munlock) |
158 | SYSCALL_SPU(mlockall) | 159 | SYSCALL_SPU(mlockall) |
159 | SYSCALL_SPU(munlockall) | 160 | SYSCALL_SPU(munlockall) |
160 | COMPAT_SYS_SPU(sched_setparam) | 161 | SYSCALL_SPU(sched_setparam) |
161 | COMPAT_SYS_SPU(sched_getparam) | 162 | SYSCALL_SPU(sched_getparam) |
162 | COMPAT_SYS_SPU(sched_setscheduler) | 163 | SYSCALL_SPU(sched_setscheduler) |
163 | COMPAT_SYS_SPU(sched_getscheduler) | 164 | SYSCALL_SPU(sched_getscheduler) |
164 | SYSCALL_SPU(sched_yield) | 165 | SYSCALL_SPU(sched_yield) |
165 | COMPAT_SYS_SPU(sched_get_priority_max) | 166 | SYSCALL_SPU(sched_get_priority_max) |
166 | COMPAT_SYS_SPU(sched_get_priority_min) | 167 | SYSCALL_SPU(sched_get_priority_min) |
167 | SYSX_SPU(sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval_wrapper,sys_sched_rr_get_interval) | 168 | COMPAT_SYS_SPU(sched_rr_get_interval) |
168 | COMPAT_SYS_SPU(nanosleep) | 169 | COMPAT_SYS_SPU(nanosleep) |
169 | SYSCALL_SPU(mremap) | 170 | SYSCALL_SPU(mremap) |
170 | SYSCALL_SPU(setresuid) | 171 | SYSCALL_SPU(setresuid) |
@@ -174,7 +175,7 @@ SYSCALL_SPU(poll) | |||
174 | SYSCALL(ni_syscall) | 175 | SYSCALL(ni_syscall) |
175 | SYSCALL_SPU(setresgid) | 176 | SYSCALL_SPU(setresgid) |
176 | SYSCALL_SPU(getresgid) | 177 | SYSCALL_SPU(getresgid) |
177 | COMPAT_SYS_SPU(prctl) | 178 | SYSCALL_SPU(prctl) |
178 | COMPAT_SYS(rt_sigreturn) | 179 | COMPAT_SYS(rt_sigreturn) |
179 | COMPAT_SYS(rt_sigaction) | 180 | COMPAT_SYS(rt_sigaction) |
180 | COMPAT_SYS(rt_sigprocmask) | 181 | COMPAT_SYS(rt_sigprocmask) |
@@ -253,7 +254,7 @@ COMPAT_SYS_SPU(clock_gettime) | |||
253 | COMPAT_SYS_SPU(clock_getres) | 254 | COMPAT_SYS_SPU(clock_getres) |
254 | COMPAT_SYS_SPU(clock_nanosleep) | 255 | COMPAT_SYS_SPU(clock_nanosleep) |
255 | SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext) | 256 | SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext) |
256 | COMPAT_SYS_SPU(tgkill) | 257 | SYSCALL_SPU(tgkill) |
257 | COMPAT_SYS_SPU(utimes) | 258 | COMPAT_SYS_SPU(utimes) |
258 | COMPAT_SYS_SPU(statfs64) | 259 | COMPAT_SYS_SPU(statfs64) |
259 | COMPAT_SYS_SPU(fstatfs64) | 260 | COMPAT_SYS_SPU(fstatfs64) |
@@ -276,8 +277,8 @@ COMPAT_SYS(add_key) | |||
276 | COMPAT_SYS(request_key) | 277 | COMPAT_SYS(request_key) |
277 | COMPAT_SYS(keyctl) | 278 | COMPAT_SYS(keyctl) |
278 | COMPAT_SYS(waitid) | 279 | COMPAT_SYS(waitid) |
279 | COMPAT_SYS(ioprio_set) | 280 | SYSCALL(ioprio_set) |
280 | COMPAT_SYS(ioprio_get) | 281 | SYSCALL(ioprio_get) |
281 | SYSCALL(inotify_init) | 282 | SYSCALL(inotify_init) |
282 | SYSCALL(inotify_add_watch) | 283 | SYSCALL(inotify_add_watch) |
283 | SYSCALL(inotify_rm_watch) | 284 | SYSCALL(inotify_rm_watch) |
diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h index 6defdd65594e..6c69ee94fd8d 100644 --- a/arch/powerpc/include/uapi/asm/signal.h +++ b/arch/powerpc/include/uapi/asm/signal.h | |||
@@ -90,6 +90,7 @@ typedef struct { | |||
90 | 90 | ||
91 | #include <asm-generic/signal-defs.h> | 91 | #include <asm-generic/signal-defs.h> |
92 | 92 | ||
93 | #ifndef __KERNEL__ | ||
93 | struct old_sigaction { | 94 | struct old_sigaction { |
94 | __sighandler_t sa_handler; | 95 | __sighandler_t sa_handler; |
95 | old_sigset_t sa_mask; | 96 | old_sigset_t sa_mask; |
@@ -97,7 +98,6 @@ struct old_sigaction { | |||
97 | __sigrestore_t sa_restorer; | 98 | __sigrestore_t sa_restorer; |
98 | }; | 99 | }; |
99 | 100 | ||
100 | #ifndef __KERNEL__ | ||
101 | struct sigaction { | 101 | struct sigaction { |
102 | __sighandler_t sa_handler; | 102 | __sighandler_t sa_handler; |
103 | unsigned long sa_flags; | 103 | unsigned long sa_flags; |
diff --git a/arch/powerpc/kernel/ppc32.h b/arch/powerpc/kernel/ppc32.h index 02fb0ee26093..a27c914d5802 100644 --- a/arch/powerpc/kernel/ppc32.h +++ b/arch/powerpc/kernel/ppc32.h | |||
@@ -16,30 +16,6 @@ | |||
16 | 16 | ||
17 | /* These are here to support 32-bit syscalls on a 64-bit kernel. */ | 17 | /* These are here to support 32-bit syscalls on a 64-bit kernel. */ |
18 | 18 | ||
19 | #define __old_sigaction32 old_sigaction32 | ||
20 | |||
21 | struct __old_sigaction32 { | ||
22 | compat_uptr_t sa_handler; | ||
23 | compat_old_sigset_t sa_mask; | ||
24 | unsigned int sa_flags; | ||
25 | compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */ | ||
26 | }; | ||
27 | |||
28 | |||
29 | |||
30 | struct sigaction32 { | ||
31 | compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */ | ||
32 | unsigned int sa_flags; | ||
33 | compat_uptr_t sa_restorer; /* Another 32 bit pointer */ | ||
34 | compat_sigset_t sa_mask; /* A 32 bit mask */ | ||
35 | }; | ||
36 | |||
37 | typedef struct sigaltstack_32 { | ||
38 | unsigned int ss_sp; | ||
39 | int ss_flags; | ||
40 | compat_size_t ss_size; | ||
41 | } stack_32_t; | ||
42 | |||
43 | struct pt_regs32 { | 19 | struct pt_regs32 { |
44 | unsigned int gpr[32]; | 20 | unsigned int gpr[32]; |
45 | unsigned int nip; | 21 | unsigned int nip; |
@@ -75,7 +51,7 @@ struct mcontext32 { | |||
75 | struct ucontext32 { | 51 | struct ucontext32 { |
76 | unsigned int uc_flags; | 52 | unsigned int uc_flags; |
77 | unsigned int uc_link; | 53 | unsigned int uc_link; |
78 | stack_32_t uc_stack; | 54 | compat_stack_t uc_stack; |
79 | int uc_pad[7]; | 55 | int uc_pad[7]; |
80 | compat_uptr_t uc_regs; /* points to uc_mcontext field */ | 56 | compat_uptr_t uc_regs; /* points to uc_mcontext field */ |
81 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 57 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index 3b997118df50..fa99dc54965c 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -169,10 +169,3 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) | |||
169 | tracehook_notify_resume(regs); | 169 | tracehook_notify_resume(regs); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | |||
173 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
174 | unsigned long r5, unsigned long r6, unsigned long r7, | ||
175 | unsigned long r8, struct pt_regs *regs) | ||
176 | { | ||
177 | return do_sigaltstack(uss, uoss, regs->gpr[1]); | ||
178 | } | ||
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 9ec3fed3caac..802ab5ea36cb 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -56,9 +56,7 @@ | |||
56 | #undef DEBUG_SIG | 56 | #undef DEBUG_SIG |
57 | 57 | ||
58 | #ifdef CONFIG_PPC64 | 58 | #ifdef CONFIG_PPC64 |
59 | #define sys_sigsuspend compat_sys_sigsuspend | ||
60 | #define sys_rt_sigreturn compat_sys_rt_sigreturn | 59 | #define sys_rt_sigreturn compat_sys_rt_sigreturn |
61 | #define sys_sigaction compat_sys_sigaction | ||
62 | #define sys_swapcontext compat_sys_swapcontext | 60 | #define sys_swapcontext compat_sys_swapcontext |
63 | #define sys_sigreturn compat_sys_sigreturn | 61 | #define sys_sigreturn compat_sys_sigreturn |
64 | 62 | ||
@@ -67,6 +65,8 @@ | |||
67 | #define mcontext mcontext32 | 65 | #define mcontext mcontext32 |
68 | #define ucontext ucontext32 | 66 | #define ucontext ucontext32 |
69 | 67 | ||
68 | #define __save_altstack __compat_save_altstack | ||
69 | |||
70 | /* | 70 | /* |
71 | * Userspace code may pass a ucontext which doesn't include VSX added | 71 | * Userspace code may pass a ucontext which doesn't include VSX added |
72 | * at the end. We need to check for this case. | 72 | * at the end. We need to check for this case. |
@@ -129,23 +129,6 @@ static inline int get_sigset_t(sigset_t *set, | |||
129 | return 0; | 129 | return 0; |
130 | } | 130 | } |
131 | 131 | ||
132 | static inline int get_old_sigaction(struct k_sigaction *new_ka, | ||
133 | struct old_sigaction __user *act) | ||
134 | { | ||
135 | compat_old_sigset_t mask; | ||
136 | compat_uptr_t handler, restorer; | ||
137 | |||
138 | if (get_user(handler, &act->sa_handler) || | ||
139 | __get_user(restorer, &act->sa_restorer) || | ||
140 | __get_user(new_ka->sa.sa_flags, &act->sa_flags) || | ||
141 | __get_user(mask, &act->sa_mask)) | ||
142 | return -EFAULT; | ||
143 | new_ka->sa.sa_handler = compat_ptr(handler); | ||
144 | new_ka->sa.sa_restorer = compat_ptr(restorer); | ||
145 | siginitset(&new_ka->sa.sa_mask, mask); | ||
146 | return 0; | ||
147 | } | ||
148 | |||
149 | #define to_user_ptr(p) ptr_to_compat(p) | 132 | #define to_user_ptr(p) ptr_to_compat(p) |
150 | #define from_user_ptr(p) compat_ptr(p) | 133 | #define from_user_ptr(p) compat_ptr(p) |
151 | 134 | ||
@@ -195,21 +178,6 @@ static inline int get_sigset_t(sigset_t *set, const sigset_t __user *uset) | |||
195 | return copy_from_user(set, uset, sizeof(*uset)); | 178 | return copy_from_user(set, uset, sizeof(*uset)); |
196 | } | 179 | } |
197 | 180 | ||
198 | static inline int get_old_sigaction(struct k_sigaction *new_ka, | ||
199 | struct old_sigaction __user *act) | ||
200 | { | ||
201 | old_sigset_t mask; | ||
202 | |||
203 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
204 | __get_user(new_ka->sa.sa_handler, &act->sa_handler) || | ||
205 | __get_user(new_ka->sa.sa_restorer, &act->sa_restorer) || | ||
206 | __get_user(new_ka->sa.sa_flags, &act->sa_flags) || | ||
207 | __get_user(mask, &act->sa_mask)) | ||
208 | return -EFAULT; | ||
209 | siginitset(&new_ka->sa.sa_mask, mask); | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | #define to_user_ptr(p) ((unsigned long)(p)) | 181 | #define to_user_ptr(p) ((unsigned long)(p)) |
214 | #define from_user_ptr(p) ((void __user *)(p)) | 182 | #define from_user_ptr(p) ((void __user *)(p)) |
215 | 183 | ||
@@ -233,50 +201,8 @@ static inline int restore_general_regs(struct pt_regs *regs, | |||
233 | return -EFAULT; | 201 | return -EFAULT; |
234 | return 0; | 202 | return 0; |
235 | } | 203 | } |
236 | |||
237 | #endif /* CONFIG_PPC64 */ | ||
238 | |||
239 | /* | ||
240 | * Atomically swap in the new signal mask, and wait for a signal. | ||
241 | */ | ||
242 | long sys_sigsuspend(old_sigset_t mask) | ||
243 | { | ||
244 | sigset_t blocked; | ||
245 | siginitset(&blocked, mask); | ||
246 | return sigsuspend(&blocked); | ||
247 | } | ||
248 | |||
249 | long sys_sigaction(int sig, struct old_sigaction __user *act, | ||
250 | struct old_sigaction __user *oact) | ||
251 | { | ||
252 | struct k_sigaction new_ka, old_ka; | ||
253 | int ret; | ||
254 | |||
255 | #ifdef CONFIG_PPC64 | ||
256 | if (sig < 0) | ||
257 | sig = -sig; | ||
258 | #endif | 204 | #endif |
259 | 205 | ||
260 | if (act) { | ||
261 | if (get_old_sigaction(&new_ka, act)) | ||
262 | return -EFAULT; | ||
263 | } | ||
264 | |||
265 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
266 | if (!ret && oact) { | ||
267 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
268 | __put_user(to_user_ptr(old_ka.sa.sa_handler), | ||
269 | &oact->sa_handler) || | ||
270 | __put_user(to_user_ptr(old_ka.sa.sa_restorer), | ||
271 | &oact->sa_restorer) || | ||
272 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
273 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
274 | return -EFAULT; | ||
275 | } | ||
276 | |||
277 | return ret; | ||
278 | } | ||
279 | |||
280 | /* | 206 | /* |
281 | * When we have signals to deliver, we set up on the | 207 | * When we have signals to deliver, we set up on the |
282 | * user stack, going down from the original stack pointer: | 208 | * user stack, going down from the original stack pointer: |
@@ -588,89 +514,6 @@ static long restore_user_regs(struct pt_regs *regs, | |||
588 | } | 514 | } |
589 | 515 | ||
590 | #ifdef CONFIG_PPC64 | 516 | #ifdef CONFIG_PPC64 |
591 | long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act, | ||
592 | struct sigaction32 __user *oact, size_t sigsetsize) | ||
593 | { | ||
594 | struct k_sigaction new_ka, old_ka; | ||
595 | int ret; | ||
596 | |||
597 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
598 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
599 | return -EINVAL; | ||
600 | |||
601 | if (act) { | ||
602 | compat_uptr_t handler; | ||
603 | |||
604 | ret = get_user(handler, &act->sa_handler); | ||
605 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
606 | ret |= get_sigset_t(&new_ka.sa.sa_mask, &act->sa_mask); | ||
607 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
608 | if (ret) | ||
609 | return -EFAULT; | ||
610 | } | ||
611 | |||
612 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
613 | if (!ret && oact) { | ||
614 | ret = put_user(to_user_ptr(old_ka.sa.sa_handler), &oact->sa_handler); | ||
615 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); | ||
616 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
617 | } | ||
618 | return ret; | ||
619 | } | ||
620 | |||
621 | /* | ||
622 | * Note: it is necessary to treat how as an unsigned int, with the | ||
623 | * corresponding cast to a signed int to insure that the proper | ||
624 | * conversion (sign extension) between the register representation | ||
625 | * of a signed int (msr in 32-bit mode) and the register representation | ||
626 | * of a signed int (msr in 64-bit mode) is performed. | ||
627 | */ | ||
628 | long compat_sys_rt_sigprocmask(u32 how, compat_sigset_t __user *set, | ||
629 | compat_sigset_t __user *oset, size_t sigsetsize) | ||
630 | { | ||
631 | sigset_t s; | ||
632 | sigset_t __user *up; | ||
633 | int ret; | ||
634 | mm_segment_t old_fs = get_fs(); | ||
635 | |||
636 | if (set) { | ||
637 | if (get_sigset_t(&s, set)) | ||
638 | return -EFAULT; | ||
639 | } | ||
640 | |||
641 | set_fs(KERNEL_DS); | ||
642 | /* This is valid because of the set_fs() */ | ||
643 | up = (sigset_t __user *) &s; | ||
644 | ret = sys_rt_sigprocmask((int)how, set ? up : NULL, oset ? up : NULL, | ||
645 | sigsetsize); | ||
646 | set_fs(old_fs); | ||
647 | if (ret) | ||
648 | return ret; | ||
649 | if (oset) { | ||
650 | if (put_sigset_t(oset, &s)) | ||
651 | return -EFAULT; | ||
652 | } | ||
653 | return 0; | ||
654 | } | ||
655 | |||
656 | long compat_sys_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize) | ||
657 | { | ||
658 | sigset_t s; | ||
659 | int ret; | ||
660 | mm_segment_t old_fs = get_fs(); | ||
661 | |||
662 | set_fs(KERNEL_DS); | ||
663 | /* The __user pointer cast is valid because of the set_fs() */ | ||
664 | ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); | ||
665 | set_fs(old_fs); | ||
666 | if (!ret) { | ||
667 | if (put_sigset_t(set, &s)) | ||
668 | return -EFAULT; | ||
669 | } | ||
670 | return ret; | ||
671 | } | ||
672 | |||
673 | |||
674 | int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s) | 517 | int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s) |
675 | { | 518 | { |
676 | int err; | 519 | int err; |
@@ -739,79 +582,6 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from) | |||
739 | 582 | ||
740 | return 0; | 583 | return 0; |
741 | } | 584 | } |
742 | |||
743 | /* | ||
744 | * Note: it is necessary to treat pid and sig as unsigned ints, with the | ||
745 | * corresponding cast to a signed int to insure that the proper conversion | ||
746 | * (sign extension) between the register representation of a signed int | ||
747 | * (msr in 32-bit mode) and the register representation of a signed int | ||
748 | * (msr in 64-bit mode) is performed. | ||
749 | */ | ||
750 | long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo) | ||
751 | { | ||
752 | siginfo_t info; | ||
753 | int ret; | ||
754 | mm_segment_t old_fs = get_fs(); | ||
755 | |||
756 | ret = copy_siginfo_from_user32(&info, uinfo); | ||
757 | if (unlikely(ret)) | ||
758 | return ret; | ||
759 | |||
760 | set_fs (KERNEL_DS); | ||
761 | /* The __user pointer cast is valid becasuse of the set_fs() */ | ||
762 | ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info); | ||
763 | set_fs (old_fs); | ||
764 | return ret; | ||
765 | } | ||
766 | /* | ||
767 | * Start Alternate signal stack support | ||
768 | * | ||
769 | * System Calls | ||
770 | * sigaltatck compat_sys_sigaltstack | ||
771 | */ | ||
772 | |||
773 | int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | ||
774 | int r6, int r7, int r8, struct pt_regs *regs) | ||
775 | { | ||
776 | stack_32_t __user * newstack = compat_ptr(__new); | ||
777 | stack_32_t __user * oldstack = compat_ptr(__old); | ||
778 | stack_t uss, uoss; | ||
779 | int ret; | ||
780 | mm_segment_t old_fs; | ||
781 | unsigned long sp; | ||
782 | compat_uptr_t ss_sp; | ||
783 | |||
784 | /* | ||
785 | * set sp to the user stack on entry to the system call | ||
786 | * the system call router sets R9 to the saved registers | ||
787 | */ | ||
788 | sp = regs->gpr[1]; | ||
789 | |||
790 | /* Put new stack info in local 64 bit stack struct */ | ||
791 | if (newstack) { | ||
792 | if (get_user(ss_sp, &newstack->ss_sp) || | ||
793 | __get_user(uss.ss_flags, &newstack->ss_flags) || | ||
794 | __get_user(uss.ss_size, &newstack->ss_size)) | ||
795 | return -EFAULT; | ||
796 | uss.ss_sp = compat_ptr(ss_sp); | ||
797 | } | ||
798 | |||
799 | old_fs = get_fs(); | ||
800 | set_fs(KERNEL_DS); | ||
801 | /* The __user pointer casts are valid because of the set_fs() */ | ||
802 | ret = do_sigaltstack( | ||
803 | newstack ? (stack_t __user *) &uss : NULL, | ||
804 | oldstack ? (stack_t __user *) &uoss : NULL, | ||
805 | sp); | ||
806 | set_fs(old_fs); | ||
807 | /* Copy the stack information to the user output buffer */ | ||
808 | if (!ret && oldstack && | ||
809 | (put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) || | ||
810 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || | ||
811 | __put_user(uoss.ss_size, &oldstack->ss_size))) | ||
812 | return -EFAULT; | ||
813 | return ret; | ||
814 | } | ||
815 | #endif /* CONFIG_PPC64 */ | 585 | #endif /* CONFIG_PPC64 */ |
816 | 586 | ||
817 | /* | 587 | /* |
@@ -838,10 +608,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, | |||
838 | if (copy_siginfo_to_user(&rt_sf->info, info) | 608 | if (copy_siginfo_to_user(&rt_sf->info, info) |
839 | || __put_user(0, &rt_sf->uc.uc_flags) | 609 | || __put_user(0, &rt_sf->uc.uc_flags) |
840 | || __put_user(0, &rt_sf->uc.uc_link) | 610 | || __put_user(0, &rt_sf->uc.uc_link) |
841 | || __put_user(current->sas_ss_sp, &rt_sf->uc.uc_stack.ss_sp) | 611 | || __save_altstack(&rt_sf->uc.uc_stack, regs->gpr[1]) |
842 | || __put_user(sas_ss_flags(regs->gpr[1]), | ||
843 | &rt_sf->uc.uc_stack.ss_flags) | ||
844 | || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size) | ||
845 | || __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext), | 612 | || __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext), |
846 | &rt_sf->uc.uc_regs) | 613 | &rt_sf->uc.uc_regs) |
847 | || put_sigset_t(&rt_sf->uc.uc_sigmask, oldset)) | 614 | || put_sigset_t(&rt_sf->uc.uc_sigmask, oldset)) |
@@ -1038,14 +805,11 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, | |||
1038 | * change it. -- paulus | 805 | * change it. -- paulus |
1039 | */ | 806 | */ |
1040 | #ifdef CONFIG_PPC64 | 807 | #ifdef CONFIG_PPC64 |
1041 | /* | 808 | if (compat_restore_altstack(&rt_sf->uc.uc_stack)) |
1042 | * We use the compat_sys_ version that does the 32/64 bits conversion | 809 | goto bad; |
1043 | * and takes userland pointer directly. What about error checking ? | ||
1044 | * nobody does any... | ||
1045 | */ | ||
1046 | compat_sys_sigaltstack((u32)(u64)&rt_sf->uc.uc_stack, 0, 0, 0, 0, 0, regs); | ||
1047 | #else | 810 | #else |
1048 | do_sigaltstack(&rt_sf->uc.uc_stack, NULL, regs->gpr[1]); | 811 | if (restore_altstack(&rt_sf->uc.uc_stack)) |
812 | goto bad; | ||
1049 | #endif | 813 | #endif |
1050 | set_thread_flag(TIF_RESTOREALL); | 814 | set_thread_flag(TIF_RESTOREALL); |
1051 | return 0; | 815 | return 0; |
@@ -1161,7 +925,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx, | |||
1161 | * always done it up until now so it is probably better not to | 925 | * always done it up until now so it is probably better not to |
1162 | * change it. -- paulus | 926 | * change it. -- paulus |
1163 | */ | 927 | */ |
1164 | do_sigaltstack(&ctx->uc_stack, NULL, regs->gpr[1]); | 928 | restore_altstack(&ctx->uc_stack); |
1165 | 929 | ||
1166 | set_thread_flag(TIF_RESTOREALL); | 930 | set_thread_flag(TIF_RESTOREALL); |
1167 | out: | 931 | out: |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 1ca045d44324..807b5b1535e9 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -368,10 +368,8 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, | |||
368 | if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext)) | 368 | if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext)) |
369 | goto badframe; | 369 | goto badframe; |
370 | 370 | ||
371 | /* do_sigaltstack expects a __user pointer and won't modify | 371 | if (restore_altstack(&uc->uc_stack)) |
372 | * what's in there anyway | 372 | goto badframe; |
373 | */ | ||
374 | do_sigaltstack(&uc->uc_stack, NULL, regs->gpr[1]); | ||
375 | 373 | ||
376 | set_thread_flag(TIF_RESTOREALL); | 374 | set_thread_flag(TIF_RESTOREALL); |
377 | return 0; | 375 | return 0; |
@@ -416,10 +414,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, | |||
416 | /* Create the ucontext. */ | 414 | /* Create the ucontext. */ |
417 | err |= __put_user(0, &frame->uc.uc_flags); | 415 | err |= __put_user(0, &frame->uc.uc_flags); |
418 | err |= __put_user(0, &frame->uc.uc_link); | 416 | err |= __put_user(0, &frame->uc.uc_link); |
419 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 417 | err |= __save_altstack(&frame->uc.uc_stack, regs->gpr[1]); |
420 | err |= __put_user(sas_ss_flags(regs->gpr[1]), | ||
421 | &frame->uc.uc_stack.ss_flags); | ||
422 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
423 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL, | 418 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL, |
424 | (unsigned long)ka->sa.sa_handler, 1); | 419 | (unsigned long)ka->sa.sa_handler, 1); |
425 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 420 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 8a93778ed9f5..dbc44ba5b078 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -61,16 +61,6 @@ asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, | |||
61 | return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x)); | 61 | return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x)); |
62 | } | 62 | } |
63 | 63 | ||
64 | /* Note: it is necessary to treat option as an unsigned int, | ||
65 | * with the corresponding cast to a signed int to insure that the | ||
66 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
67 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
68 | */ | ||
69 | asmlinkage long compat_sys_sysfs(u32 option, u32 arg1, u32 arg2) | ||
70 | { | ||
71 | return sys_sysfs((int)option, arg1, arg2); | ||
72 | } | ||
73 | |||
74 | #ifdef CONFIG_SYSVIPC | 64 | #ifdef CONFIG_SYSVIPC |
75 | long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, | 65 | long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, |
76 | u32 fifth) | 66 | u32 fifth) |
@@ -156,125 +146,6 @@ asmlinkage long compat_sys_sendfile64_wrapper(u32 out_fd, u32 in_fd, | |||
156 | (off_t __user *)offset, count); | 146 | (off_t __user *)offset, count); |
157 | } | 147 | } |
158 | 148 | ||
159 | /* Note: it is necessary to treat option as an unsigned int, | ||
160 | * with the corresponding cast to a signed int to insure that the | ||
161 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
162 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
163 | */ | ||
164 | asmlinkage long compat_sys_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 arg5) | ||
165 | { | ||
166 | return sys_prctl((int)option, | ||
167 | (unsigned long) arg2, | ||
168 | (unsigned long) arg3, | ||
169 | (unsigned long) arg4, | ||
170 | (unsigned long) arg5); | ||
171 | } | ||
172 | |||
173 | /* Note: it is necessary to treat pid as an unsigned int, | ||
174 | * with the corresponding cast to a signed int to insure that the | ||
175 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
176 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
177 | */ | ||
178 | asmlinkage long compat_sys_sched_rr_get_interval_wrapper(u32 pid, | ||
179 | struct compat_timespec __user *interval) | ||
180 | { | ||
181 | return compat_sys_sched_rr_get_interval((int)pid, interval); | ||
182 | } | ||
183 | |||
184 | /* Note: it is necessary to treat mode as an unsigned int, | ||
185 | * with the corresponding cast to a signed int to insure that the | ||
186 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
187 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
188 | */ | ||
189 | asmlinkage long compat_sys_access(const char __user * filename, u32 mode) | ||
190 | { | ||
191 | return sys_access(filename, (int)mode); | ||
192 | } | ||
193 | |||
194 | |||
195 | /* Note: it is necessary to treat mode as an unsigned int, | ||
196 | * with the corresponding cast to a signed int to insure that the | ||
197 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
198 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
199 | */ | ||
200 | asmlinkage long compat_sys_creat(const char __user * pathname, u32 mode) | ||
201 | { | ||
202 | return sys_creat(pathname, (int)mode); | ||
203 | } | ||
204 | |||
205 | |||
206 | /* Note: it is necessary to treat pid and options as unsigned ints, | ||
207 | * with the corresponding cast to a signed int to insure that the | ||
208 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
209 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
210 | */ | ||
211 | asmlinkage long compat_sys_waitpid(u32 pid, unsigned int __user * stat_addr, u32 options) | ||
212 | { | ||
213 | return sys_waitpid((int)pid, stat_addr, (int)options); | ||
214 | } | ||
215 | |||
216 | |||
217 | /* Note: it is necessary to treat gidsetsize as an unsigned int, | ||
218 | * with the corresponding cast to a signed int to insure that the | ||
219 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
220 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
221 | */ | ||
222 | asmlinkage long compat_sys_getgroups(u32 gidsetsize, gid_t __user *grouplist) | ||
223 | { | ||
224 | return sys_getgroups((int)gidsetsize, grouplist); | ||
225 | } | ||
226 | |||
227 | |||
228 | /* Note: it is necessary to treat pid as an unsigned int, | ||
229 | * with the corresponding cast to a signed int to insure that the | ||
230 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
231 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
232 | */ | ||
233 | asmlinkage long compat_sys_getpgid(u32 pid) | ||
234 | { | ||
235 | return sys_getpgid((int)pid); | ||
236 | } | ||
237 | |||
238 | |||
239 | |||
240 | /* Note: it is necessary to treat pid as an unsigned int, | ||
241 | * with the corresponding cast to a signed int to insure that the | ||
242 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
243 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
244 | */ | ||
245 | asmlinkage long compat_sys_getsid(u32 pid) | ||
246 | { | ||
247 | return sys_getsid((int)pid); | ||
248 | } | ||
249 | |||
250 | |||
251 | /* Note: it is necessary to treat pid and sig as unsigned ints, | ||
252 | * with the corresponding cast to a signed int to insure that the | ||
253 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
254 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
255 | */ | ||
256 | asmlinkage long compat_sys_kill(u32 pid, u32 sig) | ||
257 | { | ||
258 | return sys_kill((int)pid, (int)sig); | ||
259 | } | ||
260 | |||
261 | |||
262 | /* Note: it is necessary to treat mode as an unsigned int, | ||
263 | * with the corresponding cast to a signed int to insure that the | ||
264 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
265 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
266 | */ | ||
267 | asmlinkage long compat_sys_mkdir(const char __user * pathname, u32 mode) | ||
268 | { | ||
269 | return sys_mkdir(pathname, (int)mode); | ||
270 | } | ||
271 | |||
272 | long compat_sys_nice(u32 increment) | ||
273 | { | ||
274 | /* sign extend increment */ | ||
275 | return sys_nice((int)increment); | ||
276 | } | ||
277 | |||
278 | off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin) | 149 | off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin) |
279 | { | 150 | { |
280 | /* sign extend n */ | 151 | /* sign extend n */ |
@@ -293,172 +164,6 @@ long compat_sys_ftruncate(int fd, u32 length) | |||
293 | return sys_ftruncate(fd, (int)length); | 164 | return sys_ftruncate(fd, (int)length); |
294 | } | 165 | } |
295 | 166 | ||
296 | /* Note: it is necessary to treat bufsiz as an unsigned int, | ||
297 | * with the corresponding cast to a signed int to insure that the | ||
298 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
299 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
300 | */ | ||
301 | asmlinkage long compat_sys_readlink(const char __user * path, char __user * buf, u32 bufsiz) | ||
302 | { | ||
303 | return sys_readlink(path, buf, (int)bufsiz); | ||
304 | } | ||
305 | |||
306 | /* Note: it is necessary to treat option as an unsigned int, | ||
307 | * with the corresponding cast to a signed int to insure that the | ||
308 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
309 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
310 | */ | ||
311 | asmlinkage long compat_sys_sched_get_priority_max(u32 policy) | ||
312 | { | ||
313 | return sys_sched_get_priority_max((int)policy); | ||
314 | } | ||
315 | |||
316 | |||
317 | /* Note: it is necessary to treat policy as an unsigned int, | ||
318 | * with the corresponding cast to a signed int to insure that the | ||
319 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
320 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
321 | */ | ||
322 | asmlinkage long compat_sys_sched_get_priority_min(u32 policy) | ||
323 | { | ||
324 | return sys_sched_get_priority_min((int)policy); | ||
325 | } | ||
326 | |||
327 | |||
328 | /* Note: it is necessary to treat pid as an unsigned int, | ||
329 | * with the corresponding cast to a signed int to insure that the | ||
330 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
331 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
332 | */ | ||
333 | asmlinkage long compat_sys_sched_getparam(u32 pid, struct sched_param __user *param) | ||
334 | { | ||
335 | return sys_sched_getparam((int)pid, param); | ||
336 | } | ||
337 | |||
338 | |||
339 | /* Note: it is necessary to treat pid as an unsigned int, | ||
340 | * with the corresponding cast to a signed int to insure that the | ||
341 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
342 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
343 | */ | ||
344 | asmlinkage long compat_sys_sched_getscheduler(u32 pid) | ||
345 | { | ||
346 | return sys_sched_getscheduler((int)pid); | ||
347 | } | ||
348 | |||
349 | |||
350 | /* Note: it is necessary to treat pid as an unsigned int, | ||
351 | * with the corresponding cast to a signed int to insure that the | ||
352 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
353 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
354 | */ | ||
355 | asmlinkage long compat_sys_sched_setparam(u32 pid, struct sched_param __user *param) | ||
356 | { | ||
357 | return sys_sched_setparam((int)pid, param); | ||
358 | } | ||
359 | |||
360 | |||
361 | /* Note: it is necessary to treat pid and policy as unsigned ints, | ||
362 | * with the corresponding cast to a signed int to insure that the | ||
363 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
364 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
365 | */ | ||
366 | asmlinkage long compat_sys_sched_setscheduler(u32 pid, u32 policy, struct sched_param __user *param) | ||
367 | { | ||
368 | return sys_sched_setscheduler((int)pid, (int)policy, param); | ||
369 | } | ||
370 | |||
371 | |||
372 | /* Note: it is necessary to treat len as an unsigned int, | ||
373 | * with the corresponding cast to a signed int to insure that the | ||
374 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
375 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
376 | */ | ||
377 | asmlinkage long compat_sys_setdomainname(char __user *name, u32 len) | ||
378 | { | ||
379 | return sys_setdomainname(name, (int)len); | ||
380 | } | ||
381 | |||
382 | |||
383 | /* Note: it is necessary to treat gidsetsize as an unsigned int, | ||
384 | * with the corresponding cast to a signed int to insure that the | ||
385 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
386 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
387 | */ | ||
388 | asmlinkage long compat_sys_setgroups(u32 gidsetsize, gid_t __user *grouplist) | ||
389 | { | ||
390 | return sys_setgroups((int)gidsetsize, grouplist); | ||
391 | } | ||
392 | |||
393 | |||
394 | asmlinkage long compat_sys_sethostname(char __user *name, u32 len) | ||
395 | { | ||
396 | /* sign extend len */ | ||
397 | return sys_sethostname(name, (int)len); | ||
398 | } | ||
399 | |||
400 | |||
401 | /* Note: it is necessary to treat pid and pgid as unsigned ints, | ||
402 | * with the corresponding cast to a signed int to insure that the | ||
403 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
404 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
405 | */ | ||
406 | asmlinkage long compat_sys_setpgid(u32 pid, u32 pgid) | ||
407 | { | ||
408 | return sys_setpgid((int)pid, (int)pgid); | ||
409 | } | ||
410 | |||
411 | long compat_sys_getpriority(u32 which, u32 who) | ||
412 | { | ||
413 | /* sign extend which and who */ | ||
414 | return sys_getpriority((int)which, (int)who); | ||
415 | } | ||
416 | |||
417 | long compat_sys_setpriority(u32 which, u32 who, u32 niceval) | ||
418 | { | ||
419 | /* sign extend which, who and niceval */ | ||
420 | return sys_setpriority((int)which, (int)who, (int)niceval); | ||
421 | } | ||
422 | |||
423 | long compat_sys_ioprio_get(u32 which, u32 who) | ||
424 | { | ||
425 | /* sign extend which and who */ | ||
426 | return sys_ioprio_get((int)which, (int)who); | ||
427 | } | ||
428 | |||
429 | long compat_sys_ioprio_set(u32 which, u32 who, u32 ioprio) | ||
430 | { | ||
431 | /* sign extend which, who and ioprio */ | ||
432 | return sys_ioprio_set((int)which, (int)who, (int)ioprio); | ||
433 | } | ||
434 | |||
435 | /* Note: it is necessary to treat newmask as an unsigned int, | ||
436 | * with the corresponding cast to a signed int to insure that the | ||
437 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
438 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
439 | */ | ||
440 | asmlinkage long compat_sys_ssetmask(u32 newmask) | ||
441 | { | ||
442 | return sys_ssetmask((int) newmask); | ||
443 | } | ||
444 | |||
445 | asmlinkage long compat_sys_syslog(u32 type, char __user * buf, u32 len) | ||
446 | { | ||
447 | /* sign extend len */ | ||
448 | return sys_syslog(type, buf, (int)len); | ||
449 | } | ||
450 | |||
451 | |||
452 | /* Note: it is necessary to treat mask as an unsigned int, | ||
453 | * with the corresponding cast to a signed int to insure that the | ||
454 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | ||
455 | * and the register representation of a signed int (msr in 64-bit mode) is performed. | ||
456 | */ | ||
457 | asmlinkage long compat_sys_umask(u32 mask) | ||
458 | { | ||
459 | return sys_umask((int)mask); | ||
460 | } | ||
461 | |||
462 | unsigned long compat_sys_mmap2(unsigned long addr, size_t len, | 167 | unsigned long compat_sys_mmap2(unsigned long addr, size_t len, |
463 | unsigned long prot, unsigned long flags, | 168 | unsigned long prot, unsigned long flags, |
464 | unsigned long fd, unsigned long pgoff) | 169 | unsigned long fd, unsigned long pgoff) |
@@ -467,12 +172,6 @@ unsigned long compat_sys_mmap2(unsigned long addr, size_t len, | |||
467 | return sys_mmap(addr, len, prot, flags, fd, pgoff << 12); | 172 | return sys_mmap(addr, len, prot, flags, fd, pgoff << 12); |
468 | } | 173 | } |
469 | 174 | ||
470 | long compat_sys_tgkill(u32 tgid, u32 pid, int sig) | ||
471 | { | ||
472 | /* sign extend tgid, pid */ | ||
473 | return sys_tgkill((int)tgid, (int)pid, sig); | ||
474 | } | ||
475 | |||
476 | /* | 175 | /* |
477 | * long long munging: | 176 | * long long munging: |
478 | * The 32 bit ABI passes long longs in an odd even register pair. | 177 | * The 32 bit ABI passes long longs in an odd even register pair. |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b5ea38c25647..bcdcf31fa672 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -140,6 +140,13 @@ config S390 | |||
140 | select HAVE_MOD_ARCH_SPECIFIC | 140 | select HAVE_MOD_ARCH_SPECIFIC |
141 | select MODULES_USE_ELF_RELA | 141 | select MODULES_USE_ELF_RELA |
142 | select CLONE_BACKWARDS2 | 142 | select CLONE_BACKWARDS2 |
143 | select GENERIC_SIGALTSTACK | ||
144 | select GENERIC_COMPAT_RT_SIGACTION | ||
145 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
146 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
147 | select GENERIC_COMPAT_RT_SIGPENDING | ||
148 | select OLD_SIGSUSPEND3 | ||
149 | select OLD_SIGACTION | ||
143 | 150 | ||
144 | config SCHED_OMIT_FRAME_POINTER | 151 | config SCHED_OMIT_FRAME_POINTER |
145 | def_bool y | 152 | def_bool y |
@@ -249,6 +256,7 @@ config COMPAT | |||
249 | depends on 64BIT | 256 | depends on 64BIT |
250 | select COMPAT_BINFMT_ELF if BINFMT_ELF | 257 | select COMPAT_BINFMT_ELF if BINFMT_ELF |
251 | select ARCH_WANT_OLD_COMPAT_IPC | 258 | select ARCH_WANT_OLD_COMPAT_IPC |
259 | select COMPAT_OLD_SIGACTION | ||
252 | help | 260 | help |
253 | Select this option if you want to enable your system kernel to | 261 | Select this option if you want to enable your system kernel to |
254 | handle system-calls from ELF binaries for 31 bit ESA. This option | 262 | handle system-calls from ELF binaries for 31 bit ESA. This option |
diff --git a/arch/s390/include/asm/signal.h b/arch/s390/include/asm/signal.h index d26e30e31656..abf9e5735943 100644 --- a/arch/s390/include/asm/signal.h +++ b/arch/s390/include/asm/signal.h | |||
@@ -21,12 +21,5 @@ typedef struct { | |||
21 | unsigned long sig[_NSIG_WORDS]; | 21 | unsigned long sig[_NSIG_WORDS]; |
22 | } sigset_t; | 22 | } sigset_t; |
23 | 23 | ||
24 | struct old_sigaction { | ||
25 | __sighandler_t sa_handler; | ||
26 | old_sigset_t sa_mask; | ||
27 | unsigned long sa_flags; | ||
28 | void (*sa_restorer)(void); | ||
29 | }; | ||
30 | |||
31 | #define __ARCH_HAS_SA_RESTORER | 24 | #define __ARCH_HAS_SA_RESTORER |
32 | #endif | 25 | #endif |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 65cca95843e1..19f26de27fae 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -352,86 +352,6 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned | |||
352 | return sys_ftruncate(fd, (high << 32) | low); | 352 | return sys_ftruncate(fd, (high << 32) | low); |
353 | } | 353 | } |
354 | 354 | ||
355 | asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid, | ||
356 | struct compat_timespec __user *interval) | ||
357 | { | ||
358 | struct timespec t; | ||
359 | int ret; | ||
360 | mm_segment_t old_fs = get_fs (); | ||
361 | |||
362 | set_fs (KERNEL_DS); | ||
363 | ret = sys_sched_rr_get_interval(pid, | ||
364 | (struct timespec __force __user *) &t); | ||
365 | set_fs (old_fs); | ||
366 | if (put_compat_timespec(&t, interval)) | ||
367 | return -EFAULT; | ||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | ||
372 | compat_sigset_t __user *oset, size_t sigsetsize) | ||
373 | { | ||
374 | sigset_t s; | ||
375 | compat_sigset_t s32; | ||
376 | int ret; | ||
377 | mm_segment_t old_fs = get_fs(); | ||
378 | |||
379 | if (set) { | ||
380 | if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) | ||
381 | return -EFAULT; | ||
382 | s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); | ||
383 | } | ||
384 | set_fs (KERNEL_DS); | ||
385 | ret = sys_rt_sigprocmask(how, | ||
386 | set ? (sigset_t __force __user *) &s : NULL, | ||
387 | oset ? (sigset_t __force __user *) &s : NULL, | ||
388 | sigsetsize); | ||
389 | set_fs (old_fs); | ||
390 | if (ret) return ret; | ||
391 | if (oset) { | ||
392 | s32.sig[1] = (s.sig[0] >> 32); | ||
393 | s32.sig[0] = s.sig[0]; | ||
394 | if (copy_to_user (oset, &s32, sizeof(compat_sigset_t))) | ||
395 | return -EFAULT; | ||
396 | } | ||
397 | return 0; | ||
398 | } | ||
399 | |||
400 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, | ||
401 | size_t sigsetsize) | ||
402 | { | ||
403 | sigset_t s; | ||
404 | compat_sigset_t s32; | ||
405 | int ret; | ||
406 | mm_segment_t old_fs = get_fs(); | ||
407 | |||
408 | set_fs (KERNEL_DS); | ||
409 | ret = sys_rt_sigpending((sigset_t __force __user *) &s, sigsetsize); | ||
410 | set_fs (old_fs); | ||
411 | if (!ret) { | ||
412 | s32.sig[1] = (s.sig[0] >> 32); | ||
413 | s32.sig[0] = s.sig[0]; | ||
414 | if (copy_to_user (set, &s32, sizeof(compat_sigset_t))) | ||
415 | return -EFAULT; | ||
416 | } | ||
417 | return ret; | ||
418 | } | ||
419 | |||
420 | asmlinkage long | ||
421 | sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | ||
422 | { | ||
423 | siginfo_t info; | ||
424 | int ret; | ||
425 | mm_segment_t old_fs = get_fs(); | ||
426 | |||
427 | if (copy_siginfo_from_user32(&info, uinfo)) | ||
428 | return -EFAULT; | ||
429 | set_fs (KERNEL_DS); | ||
430 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __force __user *) &info); | ||
431 | set_fs (old_fs); | ||
432 | return ret; | ||
433 | } | ||
434 | |||
435 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, | 355 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, |
436 | size_t count, u32 poshi, u32 poslo) | 356 | size_t count, u32 poshi, u32 poslo) |
437 | { | 357 | { |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index d4d0239970ac..00d92a5a6f6c 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -17,13 +17,6 @@ struct ipc_kludge_32 { | |||
17 | __s32 msgtyp; | 17 | __s32 msgtyp; |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct old_sigaction32 { | ||
21 | __u32 sa_handler; /* Really a pointer, but need to deal with 32 bits */ | ||
22 | compat_old_sigset_t sa_mask; /* A 32 bit mask */ | ||
23 | __u32 sa_flags; | ||
24 | __u32 sa_restorer; /* Another 32 bit pointer */ | ||
25 | }; | ||
26 | |||
27 | /* asm/sigcontext.h */ | 20 | /* asm/sigcontext.h */ |
28 | typedef union | 21 | typedef union |
29 | { | 22 | { |
@@ -68,24 +61,12 @@ struct sigcontext32 | |||
68 | }; | 61 | }; |
69 | 62 | ||
70 | /* asm/signal.h */ | 63 | /* asm/signal.h */ |
71 | struct sigaction32 { | ||
72 | __u32 sa_handler; /* pointer */ | ||
73 | __u32 sa_flags; | ||
74 | __u32 sa_restorer; /* pointer */ | ||
75 | compat_sigset_t sa_mask; /* mask last for extensibility */ | ||
76 | }; | ||
77 | |||
78 | typedef struct { | ||
79 | __u32 ss_sp; /* pointer */ | ||
80 | int ss_flags; | ||
81 | compat_size_t ss_size; | ||
82 | } stack_t32; | ||
83 | 64 | ||
84 | /* asm/ucontext.h */ | 65 | /* asm/ucontext.h */ |
85 | struct ucontext32 { | 66 | struct ucontext32 { |
86 | __u32 uc_flags; | 67 | __u32 uc_flags; |
87 | __u32 uc_link; /* pointer */ | 68 | __u32 uc_link; /* pointer */ |
88 | stack_t32 uc_stack; | 69 | compat_stack_t uc_stack; |
89 | _sigregs32 uc_mcontext; | 70 | _sigregs32 uc_mcontext; |
90 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 71 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
91 | }; | 72 | }; |
@@ -93,8 +74,6 @@ struct ucontext32 { | |||
93 | struct stat64_emu31; | 74 | struct stat64_emu31; |
94 | struct mmap_arg_struct_emu31; | 75 | struct mmap_arg_struct_emu31; |
95 | struct fadvise64_64_args; | 76 | struct fadvise64_64_args; |
96 | struct old_sigaction32; | ||
97 | struct old_sigaction32; | ||
98 | 77 | ||
99 | long sys32_chown16(const char __user * filename, u16 user, u16 group); | 78 | long sys32_chown16(const char __user * filename, u16 user, u16 group); |
100 | long sys32_lchown16(const char __user * filename, u16 user, u16 group); | 79 | long sys32_lchown16(const char __user * filename, u16 user, u16 group); |
@@ -119,12 +98,6 @@ long sys32_ipc(u32 call, int first, int second, int third, u32 ptr); | |||
119 | long sys32_truncate64(const char __user * path, unsigned long high, | 98 | long sys32_truncate64(const char __user * path, unsigned long high, |
120 | unsigned long low); | 99 | unsigned long low); |
121 | long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low); | 100 | long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low); |
122 | long sys32_sched_rr_get_interval(compat_pid_t pid, | ||
123 | struct compat_timespec __user *interval); | ||
124 | long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | ||
125 | compat_sigset_t __user *oset, size_t sigsetsize); | ||
126 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); | ||
127 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); | ||
128 | long sys32_init_module(void __user *umod, unsigned long len, | 101 | long sys32_init_module(void __user *umod, unsigned long len, |
129 | const char __user *uargs); | 102 | const char __user *uargs); |
130 | long sys32_delete_module(const char __user *name_user, unsigned int flags); | 103 | long sys32_delete_module(const char __user *name_user, unsigned int flags); |
@@ -149,9 +122,4 @@ long sys32_read(unsigned int fd, char __user * buf, size_t count); | |||
149 | long sys32_write(unsigned int fd, const char __user * buf, size_t count); | 122 | long sys32_write(unsigned int fd, const char __user * buf, size_t count); |
150 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); | 123 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); |
151 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); | 124 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); |
152 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | ||
153 | struct old_sigaction32 __user *oact); | ||
154 | long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | ||
155 | struct sigaction32 __user *oact, size_t sigsetsize); | ||
156 | long sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss); | ||
157 | #endif /* _ASM_S390X_S390_H */ | 125 | #endif /* _ASM_S390X_S390_H */ |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 593fcc9253fc..3e71194c1902 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -157,122 +157,6 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
157 | return err; | 157 | return err; |
158 | } | 158 | } |
159 | 159 | ||
160 | asmlinkage long | ||
161 | sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | ||
162 | struct old_sigaction32 __user *oact) | ||
163 | { | ||
164 | struct k_sigaction new_ka, old_ka; | ||
165 | unsigned long sa_handler, sa_restorer; | ||
166 | int ret; | ||
167 | |||
168 | if (act) { | ||
169 | compat_old_sigset_t mask; | ||
170 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
171 | __get_user(sa_handler, &act->sa_handler) || | ||
172 | __get_user(sa_restorer, &act->sa_restorer) || | ||
173 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
174 | __get_user(mask, &act->sa_mask)) | ||
175 | return -EFAULT; | ||
176 | new_ka.sa.sa_handler = (__sighandler_t) sa_handler; | ||
177 | new_ka.sa.sa_restorer = (void (*)(void)) sa_restorer; | ||
178 | siginitset(&new_ka.sa.sa_mask, mask); | ||
179 | } | ||
180 | |||
181 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
182 | |||
183 | if (!ret && oact) { | ||
184 | sa_handler = (unsigned long) old_ka.sa.sa_handler; | ||
185 | sa_restorer = (unsigned long) old_ka.sa.sa_restorer; | ||
186 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
187 | __put_user(sa_handler, &oact->sa_handler) || | ||
188 | __put_user(sa_restorer, &oact->sa_restorer) || | ||
189 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
190 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
191 | return -EFAULT; | ||
192 | } | ||
193 | |||
194 | return ret; | ||
195 | } | ||
196 | |||
197 | asmlinkage long | ||
198 | sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | ||
199 | struct sigaction32 __user *oact, size_t sigsetsize) | ||
200 | { | ||
201 | struct k_sigaction new_ka, old_ka; | ||
202 | unsigned long sa_handler; | ||
203 | int ret; | ||
204 | compat_sigset_t set32; | ||
205 | |||
206 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
207 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
208 | return -EINVAL; | ||
209 | |||
210 | if (act) { | ||
211 | ret = get_user(sa_handler, &act->sa_handler); | ||
212 | ret |= __copy_from_user(&set32, &act->sa_mask, | ||
213 | sizeof(compat_sigset_t)); | ||
214 | new_ka.sa.sa_mask.sig[0] = | ||
215 | set32.sig[0] | (((long)set32.sig[1]) << 32); | ||
216 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
217 | |||
218 | if (ret) | ||
219 | return -EFAULT; | ||
220 | new_ka.sa.sa_handler = (__sighandler_t) sa_handler; | ||
221 | } | ||
222 | |||
223 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
224 | |||
225 | if (!ret && oact) { | ||
226 | set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); | ||
227 | set32.sig[0] = old_ka.sa.sa_mask.sig[0]; | ||
228 | ret = put_user((unsigned long)old_ka.sa.sa_handler, &oact->sa_handler); | ||
229 | ret |= __copy_to_user(&oact->sa_mask, &set32, | ||
230 | sizeof(compat_sigset_t)); | ||
231 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
232 | } | ||
233 | |||
234 | return ret; | ||
235 | } | ||
236 | |||
237 | asmlinkage long | ||
238 | sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss) | ||
239 | { | ||
240 | struct pt_regs *regs = task_pt_regs(current); | ||
241 | stack_t kss, koss; | ||
242 | unsigned long ss_sp; | ||
243 | int ret, err = 0; | ||
244 | mm_segment_t old_fs = get_fs(); | ||
245 | |||
246 | if (uss) { | ||
247 | if (!access_ok(VERIFY_READ, uss, sizeof(*uss))) | ||
248 | return -EFAULT; | ||
249 | err |= __get_user(ss_sp, &uss->ss_sp); | ||
250 | err |= __get_user(kss.ss_size, &uss->ss_size); | ||
251 | err |= __get_user(kss.ss_flags, &uss->ss_flags); | ||
252 | if (err) | ||
253 | return -EFAULT; | ||
254 | kss.ss_sp = (void __user *) ss_sp; | ||
255 | } | ||
256 | |||
257 | set_fs (KERNEL_DS); | ||
258 | ret = do_sigaltstack((stack_t __force __user *) (uss ? &kss : NULL), | ||
259 | (stack_t __force __user *) (uoss ? &koss : NULL), | ||
260 | regs->gprs[15]); | ||
261 | set_fs (old_fs); | ||
262 | |||
263 | if (!ret && uoss) { | ||
264 | if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) | ||
265 | return -EFAULT; | ||
266 | ss_sp = (unsigned long) koss.ss_sp; | ||
267 | err |= __put_user(ss_sp, &uoss->ss_sp); | ||
268 | err |= __put_user(koss.ss_size, &uoss->ss_size); | ||
269 | err |= __put_user(koss.ss_flags, &uoss->ss_flags); | ||
270 | if (err) | ||
271 | return -EFAULT; | ||
272 | } | ||
273 | return ret; | ||
274 | } | ||
275 | |||
276 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) | 160 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) |
277 | { | 161 | { |
278 | _s390_regs_common32 regs32; | 162 | _s390_regs_common32 regs32; |
@@ -380,10 +264,6 @@ asmlinkage long sys32_rt_sigreturn(void) | |||
380 | struct pt_regs *regs = task_pt_regs(current); | 264 | struct pt_regs *regs = task_pt_regs(current); |
381 | rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15]; | 265 | rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15]; |
382 | sigset_t set; | 266 | sigset_t set; |
383 | stack_t st; | ||
384 | __u32 ss_sp; | ||
385 | int err; | ||
386 | mm_segment_t old_fs = get_fs(); | ||
387 | 267 | ||
388 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 268 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
389 | goto badframe; | 269 | goto badframe; |
@@ -394,15 +274,8 @@ asmlinkage long sys32_rt_sigreturn(void) | |||
394 | goto badframe; | 274 | goto badframe; |
395 | if (restore_sigregs_gprs_high(regs, frame->gprs_high)) | 275 | if (restore_sigregs_gprs_high(regs, frame->gprs_high)) |
396 | goto badframe; | 276 | goto badframe; |
397 | err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp); | 277 | if (compat_restore_altstack(&frame->uc.uc_stack)) |
398 | st.ss_sp = compat_ptr(ss_sp); | ||
399 | err |= __get_user(st.ss_size, &frame->uc.uc_stack.ss_size); | ||
400 | err |= __get_user(st.ss_flags, &frame->uc.uc_stack.ss_flags); | ||
401 | if (err) | ||
402 | goto badframe; | 278 | goto badframe; |
403 | set_fs (KERNEL_DS); | ||
404 | do_sigaltstack((stack_t __force __user *)&st, NULL, regs->gprs[15]); | ||
405 | set_fs (old_fs); | ||
406 | return regs->gprs[2]; | 279 | return regs->gprs[2]; |
407 | badframe: | 280 | badframe: |
408 | force_sig(SIGSEGV, current); | 281 | force_sig(SIGSEGV, current); |
@@ -530,10 +403,7 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
530 | /* Create the ucontext. */ | 403 | /* Create the ucontext. */ |
531 | err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags); | 404 | err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags); |
532 | err |= __put_user(0, &frame->uc.uc_link); | 405 | err |= __put_user(0, &frame->uc.uc_link); |
533 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 406 | err |= __compat_save_altstack(&frame->uc.uc_stack, regs->gprs[15]); |
534 | err |= __put_user(sas_ss_flags(regs->gprs[15]), | ||
535 | &frame->uc.uc_stack.ss_flags); | ||
536 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
537 | err |= save_sigregs32(regs, &frame->uc.uc_mcontext); | 407 | err |= save_sigregs32(regs, &frame->uc.uc_mcontext); |
538 | err |= save_sigregs_gprs_high(regs, frame->gprs_high); | 408 | err |= save_sigregs_gprs_high(regs, frame->gprs_high); |
539 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 409 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 9b9a805656b5..c14faf39ae36 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -24,12 +24,6 @@ ENTRY(sys32_write_wrapper) | |||
24 | llgfr %r4,%r4 # size_t | 24 | llgfr %r4,%r4 # size_t |
25 | jg sys32_write # branch to system call | 25 | jg sys32_write # branch to system call |
26 | 26 | ||
27 | ENTRY(sys32_open_wrapper) | ||
28 | llgtr %r2,%r2 # const char * | ||
29 | lgfr %r3,%r3 # int | ||
30 | lgfr %r4,%r4 # int | ||
31 | jg compat_sys_open # branch to system call | ||
32 | |||
33 | ENTRY(sys32_close_wrapper) | 27 | ENTRY(sys32_close_wrapper) |
34 | llgfr %r2,%r2 # unsigned int | 28 | llgfr %r2,%r2 # unsigned int |
35 | jg sys_close # branch to system call | 29 | jg sys_close # branch to system call |
@@ -226,12 +220,6 @@ ENTRY(sys32_dup2_wrapper) | |||
226 | 220 | ||
227 | #sys32_setsid_wrapper # void | 221 | #sys32_setsid_wrapper # void |
228 | 222 | ||
229 | ENTRY(sys32_sigaction_wrapper) | ||
230 | lgfr %r2,%r2 # int | ||
231 | llgtr %r3,%r3 # const struct old_sigaction * | ||
232 | llgtr %r4,%r4 # struct old_sigaction32 * | ||
233 | jg sys32_sigaction # branch to system call | ||
234 | |||
235 | ENTRY(sys32_setreuid16_wrapper) | 223 | ENTRY(sys32_setreuid16_wrapper) |
236 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t | 224 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t |
237 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t | 225 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t |
@@ -396,17 +384,6 @@ ENTRY(sys32_syslog_wrapper) | |||
396 | lgfr %r4,%r4 # int | 384 | lgfr %r4,%r4 # int |
397 | jg sys_syslog # branch to system call | 385 | jg sys_syslog # branch to system call |
398 | 386 | ||
399 | ENTRY(compat_sys_setitimer_wrapper) | ||
400 | lgfr %r2,%r2 # int | ||
401 | llgtr %r3,%r3 # struct itimerval_emu31 * | ||
402 | llgtr %r4,%r4 # struct itimerval_emu31 * | ||
403 | jg compat_sys_setitimer # branch to system call | ||
404 | |||
405 | ENTRY(compat_sys_getitimer_wrapper) | ||
406 | lgfr %r2,%r2 # int | ||
407 | llgtr %r3,%r3 # struct itimerval_emu31 * | ||
408 | jg compat_sys_getitimer # branch to system call | ||
409 | |||
410 | ENTRY(compat_sys_newstat_wrapper) | 387 | ENTRY(compat_sys_newstat_wrapper) |
411 | llgtr %r2,%r2 # char * | 388 | llgtr %r2,%r2 # char * |
412 | llgtr %r3,%r3 # struct stat_emu31 * | 389 | llgtr %r3,%r3 # struct stat_emu31 * |
@@ -424,13 +401,6 @@ ENTRY(compat_sys_newfstat_wrapper) | |||
424 | 401 | ||
425 | #sys32_vhangup_wrapper # void | 402 | #sys32_vhangup_wrapper # void |
426 | 403 | ||
427 | ENTRY(compat_sys_wait4_wrapper) | ||
428 | lgfr %r2,%r2 # pid_t | ||
429 | llgtr %r3,%r3 # unsigned int * | ||
430 | lgfr %r4,%r4 # int | ||
431 | llgtr %r5,%r5 # struct rusage * | ||
432 | jg compat_sys_wait4 # branch to system call | ||
433 | |||
434 | ENTRY(sys32_swapoff_wrapper) | 404 | ENTRY(sys32_swapoff_wrapper) |
435 | llgtr %r2,%r2 # const char * | 405 | llgtr %r2,%r2 # const char * |
436 | jg sys_swapoff # branch to system call | 406 | jg sys_swapoff # branch to system call |
@@ -474,12 +444,6 @@ ENTRY(sys32_mprotect_wrapper) | |||
474 | llgfr %r4,%r4 # unsigned long | 444 | llgfr %r4,%r4 # unsigned long |
475 | jg sys_mprotect # branch to system call | 445 | jg sys_mprotect # branch to system call |
476 | 446 | ||
477 | ENTRY(compat_sys_sigprocmask_wrapper) | ||
478 | lgfr %r2,%r2 # int | ||
479 | llgtr %r3,%r3 # compat_old_sigset_t * | ||
480 | llgtr %r4,%r4 # compat_old_sigset_t * | ||
481 | jg compat_sys_sigprocmask # branch to system call | ||
482 | |||
483 | ENTRY(sys_init_module_wrapper) | 447 | ENTRY(sys_init_module_wrapper) |
484 | llgtr %r2,%r2 # void * | 448 | llgtr %r2,%r2 # void * |
485 | llgfr %r3,%r3 # unsigned long | 449 | llgfr %r3,%r3 # unsigned long |
@@ -628,11 +592,6 @@ ENTRY(sys32_sched_get_priority_min_wrapper) | |||
628 | lgfr %r2,%r2 # int | 592 | lgfr %r2,%r2 # int |
629 | jg sys_sched_get_priority_min # branch to system call | 593 | jg sys_sched_get_priority_min # branch to system call |
630 | 594 | ||
631 | ENTRY(sys32_sched_rr_get_interval_wrapper) | ||
632 | lgfr %r2,%r2 # pid_t | ||
633 | llgtr %r3,%r3 # struct compat_timespec * | ||
634 | jg sys32_sched_rr_get_interval # branch to system call | ||
635 | |||
636 | ENTRY(compat_sys_nanosleep_wrapper) | 595 | ENTRY(compat_sys_nanosleep_wrapper) |
637 | llgtr %r2,%r2 # struct compat_timespec * | 596 | llgtr %r2,%r2 # struct compat_timespec * |
638 | llgtr %r3,%r3 # struct compat_timespec * | 597 | llgtr %r3,%r3 # struct compat_timespec * |
@@ -686,43 +645,6 @@ ENTRY(sys32_prctl_wrapper) | |||
686 | 645 | ||
687 | #sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue | 646 | #sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue |
688 | 647 | ||
689 | ENTRY(sys32_rt_sigaction_wrapper) | ||
690 | lgfr %r2,%r2 # int | ||
691 | llgtr %r3,%r3 # const struct sigaction_emu31 * | ||
692 | llgtr %r4,%r4 # const struct sigaction_emu31 * | ||
693 | llgfr %r5,%r5 # size_t | ||
694 | jg sys32_rt_sigaction # branch to system call | ||
695 | |||
696 | ENTRY(sys32_rt_sigprocmask_wrapper) | ||
697 | lgfr %r2,%r2 # int | ||
698 | llgtr %r3,%r3 # old_sigset_emu31 * | ||
699 | llgtr %r4,%r4 # old_sigset_emu31 * | ||
700 | llgfr %r5,%r5 # size_t | ||
701 | jg sys32_rt_sigprocmask # branch to system call | ||
702 | |||
703 | ENTRY(sys32_rt_sigpending_wrapper) | ||
704 | llgtr %r2,%r2 # sigset_emu31 * | ||
705 | llgfr %r3,%r3 # size_t | ||
706 | jg sys32_rt_sigpending # branch to system call | ||
707 | |||
708 | ENTRY(compat_sys_rt_sigtimedwait_wrapper) | ||
709 | llgtr %r2,%r2 # const sigset_emu31_t * | ||
710 | llgtr %r3,%r3 # siginfo_emu31_t * | ||
711 | llgtr %r4,%r4 # const struct compat_timespec * | ||
712 | llgfr %r5,%r5 # size_t | ||
713 | jg compat_sys_rt_sigtimedwait # branch to system call | ||
714 | |||
715 | ENTRY(sys32_rt_sigqueueinfo_wrapper) | ||
716 | lgfr %r2,%r2 # int | ||
717 | lgfr %r3,%r3 # int | ||
718 | llgtr %r4,%r4 # siginfo_emu31_t * | ||
719 | jg sys32_rt_sigqueueinfo # branch to system call | ||
720 | |||
721 | ENTRY(compat_sys_rt_sigsuspend_wrapper) | ||
722 | llgtr %r2,%r2 # compat_sigset_t * | ||
723 | llgfr %r3,%r3 # compat_size_t | ||
724 | jg compat_sys_rt_sigsuspend | ||
725 | |||
726 | ENTRY(sys32_pread64_wrapper) | 648 | ENTRY(sys32_pread64_wrapper) |
727 | llgfr %r2,%r2 # unsigned int | 649 | llgfr %r2,%r2 # unsigned int |
728 | llgtr %r3,%r3 # char * | 650 | llgtr %r3,%r3 # char * |
@@ -760,11 +682,6 @@ ENTRY(sys32_capset_wrapper) | |||
760 | llgtr %r3,%r3 # const cap_user_data_t | 682 | llgtr %r3,%r3 # const cap_user_data_t |
761 | jg sys_capset # branch to system call | 683 | jg sys_capset # branch to system call |
762 | 684 | ||
763 | ENTRY(sys32_sigaltstack_wrapper) | ||
764 | llgtr %r2,%r2 # const stack_emu31_t * | ||
765 | llgtr %r3,%r3 # stack_emu31_t * | ||
766 | jg sys32_sigaltstack | ||
767 | |||
768 | ENTRY(sys32_sendfile_wrapper) | 685 | ENTRY(sys32_sendfile_wrapper) |
769 | lgfr %r2,%r2 # int | 686 | lgfr %r2,%r2 # int |
770 | lgfr %r3,%r3 # int | 687 | lgfr %r3,%r3 # int |
@@ -921,16 +838,6 @@ ENTRY(sys32_fstat64_wrapper) | |||
921 | llgtr %r3,%r3 # struct stat64 * | 838 | llgtr %r3,%r3 # struct stat64 * |
922 | jg sys32_fstat64 # branch to system call | 839 | jg sys32_fstat64 # branch to system call |
923 | 840 | ||
924 | ENTRY(compat_sys_futex_wrapper) | ||
925 | llgtr %r2,%r2 # u32 * | ||
926 | lgfr %r3,%r3 # int | ||
927 | lgfr %r4,%r4 # int | ||
928 | llgtr %r5,%r5 # struct compat_timespec * | ||
929 | llgtr %r6,%r6 # u32 * | ||
930 | lgf %r0,164(%r15) # int | ||
931 | stg %r0,160(%r15) | ||
932 | jg compat_sys_futex # branch to system call | ||
933 | |||
934 | ENTRY(sys32_setxattr_wrapper) | 841 | ENTRY(sys32_setxattr_wrapper) |
935 | llgtr %r2,%r2 # char * | 842 | llgtr %r2,%r2 # char * |
936 | llgtr %r3,%r3 # char * | 843 | llgtr %r3,%r3 # char * |
@@ -1216,14 +1123,6 @@ ENTRY(sys32_remap_file_pages_wrapper) | |||
1216 | llgfr %r6,%r6 # unsigned long | 1123 | llgfr %r6,%r6 # unsigned long |
1217 | jg sys_remap_file_pages | 1124 | jg sys_remap_file_pages |
1218 | 1125 | ||
1219 | ENTRY(compat_sys_waitid_wrapper) | ||
1220 | lgfr %r2,%r2 # int | ||
1221 | lgfr %r3,%r3 # pid_t | ||
1222 | llgtr %r4,%r4 # siginfo_emu31_t * | ||
1223 | lgfr %r5,%r5 # int | ||
1224 | llgtr %r6,%r6 # struct rusage_emu31 * | ||
1225 | jg compat_sys_waitid | ||
1226 | |||
1227 | ENTRY(compat_sys_kexec_load_wrapper) | 1126 | ENTRY(compat_sys_kexec_load_wrapper) |
1228 | llgfr %r2,%r2 # unsigned long | 1127 | llgfr %r2,%r2 # unsigned long |
1229 | llgfr %r3,%r3 # unsigned long | 1128 | llgfr %r3,%r3 # unsigned long |
@@ -1253,13 +1152,6 @@ ENTRY(sys_inotify_rm_watch_wrapper) | |||
1253 | llgfr %r3,%r3 # u32 | 1152 | llgfr %r3,%r3 # u32 |
1254 | jg sys_inotify_rm_watch | 1153 | jg sys_inotify_rm_watch |
1255 | 1154 | ||
1256 | ENTRY(compat_sys_openat_wrapper) | ||
1257 | llgfr %r2,%r2 # unsigned int | ||
1258 | llgtr %r3,%r3 # const char * | ||
1259 | lgfr %r4,%r4 # int | ||
1260 | lgfr %r5,%r5 # int | ||
1261 | jg compat_sys_openat | ||
1262 | |||
1263 | ENTRY(sys_mkdirat_wrapper) | 1155 | ENTRY(sys_mkdirat_wrapper) |
1264 | lgfr %r2,%r2 # int | 1156 | lgfr %r2,%r2 # int |
1265 | llgtr %r3,%r3 # const char * | 1157 | llgtr %r3,%r3 # const char * |
@@ -1362,17 +1254,6 @@ ENTRY(sys_unshare_wrapper) | |||
1362 | llgfr %r2,%r2 # unsigned long | 1254 | llgfr %r2,%r2 # unsigned long |
1363 | jg sys_unshare | 1255 | jg sys_unshare |
1364 | 1256 | ||
1365 | ENTRY(compat_sys_set_robust_list_wrapper) | ||
1366 | llgtr %r2,%r2 # struct compat_robust_list_head * | ||
1367 | llgfr %r3,%r3 # size_t | ||
1368 | jg compat_sys_set_robust_list | ||
1369 | |||
1370 | ENTRY(compat_sys_get_robust_list_wrapper) | ||
1371 | lgfr %r2,%r2 # int | ||
1372 | llgtr %r3,%r3 # compat_uptr_t_t * | ||
1373 | llgtr %r4,%r4 # compat_size_t * | ||
1374 | jg compat_sys_get_robust_list | ||
1375 | |||
1376 | ENTRY(sys_splice_wrapper) | 1257 | ENTRY(sys_splice_wrapper) |
1377 | lgfr %r2,%r2 # int | 1258 | lgfr %r2,%r2 # int |
1378 | llgtr %r3,%r3 # loff_t * | 1259 | llgtr %r3,%r3 # loff_t * |
@@ -1458,18 +1339,6 @@ ENTRY(sys_timerfd_create_wrapper) | |||
1458 | lgfr %r3,%r3 # int | 1339 | lgfr %r3,%r3 # int |
1459 | jg sys_timerfd_create | 1340 | jg sys_timerfd_create |
1460 | 1341 | ||
1461 | ENTRY(compat_sys_timerfd_settime_wrapper) | ||
1462 | lgfr %r2,%r2 # int | ||
1463 | lgfr %r3,%r3 # int | ||
1464 | llgtr %r4,%r4 # struct compat_itimerspec * | ||
1465 | llgtr %r5,%r5 # struct compat_itimerspec * | ||
1466 | jg compat_sys_timerfd_settime | ||
1467 | |||
1468 | ENTRY(compat_sys_timerfd_gettime_wrapper) | ||
1469 | lgfr %r2,%r2 # int | ||
1470 | llgtr %r3,%r3 # struct compat_itimerspec * | ||
1471 | jg compat_sys_timerfd_gettime | ||
1472 | |||
1473 | ENTRY(compat_sys_signalfd4_wrapper) | 1342 | ENTRY(compat_sys_signalfd4_wrapper) |
1474 | lgfr %r2,%r2 # int | 1343 | lgfr %r2,%r2 # int |
1475 | llgtr %r3,%r3 # compat_sigset_t * | 1344 | llgtr %r3,%r3 # compat_sigset_t * |
@@ -1550,13 +1419,6 @@ ENTRY(compat_sys_pwritev_wrapper) | |||
1550 | llgfr %r6,%r6 # u32 | 1419 | llgfr %r6,%r6 # u32 |
1551 | jg compat_sys_pwritev # branch to system call | 1420 | jg compat_sys_pwritev # branch to system call |
1552 | 1421 | ||
1553 | ENTRY(compat_sys_rt_tgsigqueueinfo_wrapper) | ||
1554 | lgfr %r2,%r2 # compat_pid_t | ||
1555 | lgfr %r3,%r3 # compat_pid_t | ||
1556 | lgfr %r4,%r4 # int | ||
1557 | llgtr %r5,%r5 # struct compat_siginfo * | ||
1558 | jg compat_sys_rt_tgsigqueueinfo_wrapper # branch to system call | ||
1559 | |||
1560 | ENTRY(sys_perf_event_open_wrapper) | 1422 | ENTRY(sys_perf_event_open_wrapper) |
1561 | llgtr %r2,%r2 # const struct perf_event_attr * | 1423 | llgtr %r2,%r2 # const struct perf_event_attr * |
1562 | lgfr %r3,%r3 # pid_t | 1424 | lgfr %r3,%r3 # pid_t |
@@ -1607,12 +1469,6 @@ ENTRY(sys_name_to_handle_at_wrapper) | |||
1607 | lgfr %r6,%r6 # int | 1469 | lgfr %r6,%r6 # int |
1608 | jg sys_name_to_handle_at | 1470 | jg sys_name_to_handle_at |
1609 | 1471 | ||
1610 | ENTRY(compat_sys_open_by_handle_at_wrapper) | ||
1611 | lgfr %r2,%r2 # int | ||
1612 | llgtr %r3,%r3 # struct file_handle __user * | ||
1613 | lgfr %r4,%r4 # int | ||
1614 | jg compat_sys_open_by_handle_at | ||
1615 | |||
1616 | ENTRY(compat_sys_clock_adjtime_wrapper) | 1472 | ENTRY(compat_sys_clock_adjtime_wrapper) |
1617 | lgfr %r2,%r2 # clockid_t (int) | 1473 | lgfr %r2,%r2 # clockid_t (int) |
1618 | llgtr %r3,%r3 # struct compat_timex __user * | 1474 | llgtr %r3,%r3 # struct compat_timex __user * |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index 2711936fe706..c3a736a3ed44 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -73,10 +73,6 @@ long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, | |||
73 | long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); | 73 | long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); |
74 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, | 74 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, |
75 | u32 len_low); | 75 | u32 len_low); |
76 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); | ||
77 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
78 | struct old_sigaction __user *oact); | ||
79 | long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss); | ||
80 | long sys_sigreturn(void); | 76 | long sys_sigreturn(void); |
81 | long sys_rt_sigreturn(void); | 77 | long sys_rt_sigreturn(void); |
82 | long sys32_sigreturn(void); | 78 | long sys32_sigreturn(void); |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index c3ff70a7b247..9c6e747a5e1e 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -48,54 +48,6 @@ typedef struct | |||
48 | struct ucontext uc; | 48 | struct ucontext uc; |
49 | } rt_sigframe; | 49 | } rt_sigframe; |
50 | 50 | ||
51 | /* | ||
52 | * Atomically swap in the new signal mask, and wait for a signal. | ||
53 | */ | ||
54 | SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) | ||
55 | { | ||
56 | sigset_t blocked; | ||
57 | siginitset(&blocked, mask); | ||
58 | return sigsuspend(&blocked); | ||
59 | } | ||
60 | |||
61 | SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, | ||
62 | struct old_sigaction __user *, oact) | ||
63 | { | ||
64 | struct k_sigaction new_ka, old_ka; | ||
65 | int ret; | ||
66 | |||
67 | if (act) { | ||
68 | old_sigset_t mask; | ||
69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
71 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
72 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
73 | __get_user(mask, &act->sa_mask)) | ||
74 | return -EFAULT; | ||
75 | siginitset(&new_ka.sa.sa_mask, mask); | ||
76 | } | ||
77 | |||
78 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
79 | |||
80 | if (!ret && oact) { | ||
81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
83 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
84 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
85 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
86 | return -EFAULT; | ||
87 | } | ||
88 | |||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, | ||
93 | stack_t __user *, uoss) | ||
94 | { | ||
95 | struct pt_regs *regs = task_pt_regs(current); | ||
96 | return do_sigaltstack(uss, uoss, regs->gprs[15]); | ||
97 | } | ||
98 | |||
99 | /* Returns non-zero on fault. */ | 51 | /* Returns non-zero on fault. */ |
100 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | 52 | static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) |
101 | { | 53 | { |
@@ -190,8 +142,7 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
190 | set_current_blocked(&set); | 142 | set_current_blocked(&set); |
191 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) | 143 | if (restore_sigregs(regs, &frame->uc.uc_mcontext)) |
192 | goto badframe; | 144 | goto badframe; |
193 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, | 145 | if (restore_altstack(&frame->uc.uc_stack)) |
194 | regs->gprs[15]) == -EFAULT) | ||
195 | goto badframe; | 146 | goto badframe; |
196 | return regs->gprs[2]; | 147 | return regs->gprs[2]; |
197 | badframe: | 148 | badframe: |
@@ -325,10 +276,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
325 | /* Create the ucontext. */ | 276 | /* Create the ucontext. */ |
326 | err |= __put_user(0, &frame->uc.uc_flags); | 277 | err |= __put_user(0, &frame->uc.uc_flags); |
327 | err |= __put_user(NULL, &frame->uc.uc_link); | 278 | err |= __put_user(NULL, &frame->uc.uc_link); |
328 | err |= __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 279 | err |= __save_altstack(&frame->uc.uc_stack, regs->gprs[15]); |
329 | err |= __put_user(sas_ss_flags(regs->gprs[15]), | ||
330 | &frame->uc.uc_stack.ss_flags); | ||
331 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
332 | err |= save_sigregs(regs, &frame->uc.uc_mcontext); | 280 | err |= save_sigregs(regs, &frame->uc.uc_mcontext); |
333 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 281 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
334 | if (err) | 282 | if (err) |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 6a6c61f94dd3..aaac708aa110 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -13,7 +13,7 @@ SYSCALL(sys_exit,sys_exit,sys32_exit_wrapper) | |||
13 | SYSCALL(sys_fork,sys_fork,sys_fork) | 13 | SYSCALL(sys_fork,sys_fork,sys_fork) |
14 | SYSCALL(sys_read,sys_read,sys32_read_wrapper) | 14 | SYSCALL(sys_read,sys_read,sys32_read_wrapper) |
15 | SYSCALL(sys_write,sys_write,sys32_write_wrapper) | 15 | SYSCALL(sys_write,sys_write,sys32_write_wrapper) |
16 | SYSCALL(sys_open,sys_open,sys32_open_wrapper) /* 5 */ | 16 | SYSCALL(sys_open,sys_open,compat_sys_open) /* 5 */ |
17 | SYSCALL(sys_close,sys_close,sys32_close_wrapper) | 17 | SYSCALL(sys_close,sys_close,sys32_close_wrapper) |
18 | SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) | 18 | SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) |
19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) | 19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) |
@@ -75,7 +75,7 @@ SYSCALL(sys_dup2,sys_dup2,sys32_dup2_wrapper) | |||
75 | SYSCALL(sys_getppid,sys_getppid,sys_getppid) | 75 | SYSCALL(sys_getppid,sys_getppid,sys_getppid) |
76 | SYSCALL(sys_getpgrp,sys_getpgrp,sys_getpgrp) /* 65 */ | 76 | SYSCALL(sys_getpgrp,sys_getpgrp,sys_getpgrp) /* 65 */ |
77 | SYSCALL(sys_setsid,sys_setsid,sys_setsid) | 77 | SYSCALL(sys_setsid,sys_setsid,sys_setsid) |
78 | SYSCALL(sys_sigaction,sys_sigaction,sys32_sigaction_wrapper) | 78 | SYSCALL(sys_sigaction,sys_sigaction,compat_sys_sigaction) |
79 | NI_SYSCALL /* old sgetmask syscall*/ | 79 | NI_SYSCALL /* old sgetmask syscall*/ |
80 | NI_SYSCALL /* old ssetmask syscall*/ | 80 | NI_SYSCALL /* old ssetmask syscall*/ |
81 | SYSCALL(sys_setreuid16,sys_ni_syscall,sys32_setreuid16_wrapper) /* old setreuid16 syscall */ | 81 | SYSCALL(sys_setreuid16,sys_ni_syscall,sys32_setreuid16_wrapper) /* old setreuid16 syscall */ |
@@ -112,8 +112,8 @@ SYSCALL(sys_fstatfs,sys_fstatfs,compat_sys_fstatfs_wrapper) /* 100 */ | |||
112 | NI_SYSCALL /* ioperm for i386 */ | 112 | NI_SYSCALL /* ioperm for i386 */ |
113 | SYSCALL(sys_socketcall,sys_socketcall,compat_sys_socketcall_wrapper) | 113 | SYSCALL(sys_socketcall,sys_socketcall,compat_sys_socketcall_wrapper) |
114 | SYSCALL(sys_syslog,sys_syslog,sys32_syslog_wrapper) | 114 | SYSCALL(sys_syslog,sys_syslog,sys32_syslog_wrapper) |
115 | SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer_wrapper) | 115 | SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer) |
116 | SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer_wrapper) /* 105 */ | 116 | SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer) /* 105 */ |
117 | SYSCALL(sys_newstat,sys_newstat,compat_sys_newstat_wrapper) | 117 | SYSCALL(sys_newstat,sys_newstat,compat_sys_newstat_wrapper) |
118 | SYSCALL(sys_newlstat,sys_newlstat,compat_sys_newlstat_wrapper) | 118 | SYSCALL(sys_newlstat,sys_newlstat,compat_sys_newlstat_wrapper) |
119 | SYSCALL(sys_newfstat,sys_newfstat,compat_sys_newfstat_wrapper) | 119 | SYSCALL(sys_newfstat,sys_newfstat,compat_sys_newfstat_wrapper) |
@@ -122,7 +122,7 @@ SYSCALL(sys_lookup_dcookie,sys_lookup_dcookie,sys32_lookup_dcookie_wrapper) /* 1 | |||
122 | SYSCALL(sys_vhangup,sys_vhangup,sys_vhangup) | 122 | SYSCALL(sys_vhangup,sys_vhangup,sys_vhangup) |
123 | NI_SYSCALL /* old "idle" system call */ | 123 | NI_SYSCALL /* old "idle" system call */ |
124 | NI_SYSCALL /* vm86old for i386 */ | 124 | NI_SYSCALL /* vm86old for i386 */ |
125 | SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4_wrapper) | 125 | SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4) |
126 | SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */ | 126 | SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */ |
127 | SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) | 127 | SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) |
128 | SYSCALL(sys_s390_ipc,sys_s390_ipc,sys32_ipc_wrapper) | 128 | SYSCALL(sys_s390_ipc,sys_s390_ipc,sys32_ipc_wrapper) |
@@ -134,7 +134,7 @@ SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper) | |||
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) |
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |
137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper) | 137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask) |
138 | NI_SYSCALL /* old "create module" */ | 138 | NI_SYSCALL /* old "create module" */ |
139 | SYSCALL(sys_init_module,sys_init_module,sys_init_module_wrapper) | 139 | SYSCALL(sys_init_module,sys_init_module,sys_init_module_wrapper) |
140 | SYSCALL(sys_delete_module,sys_delete_module,sys_delete_module_wrapper) | 140 | SYSCALL(sys_delete_module,sys_delete_module,sys_delete_module_wrapper) |
@@ -169,7 +169,7 @@ SYSCALL(sys_sched_getscheduler,sys_sched_getscheduler,sys32_sched_getscheduler_w | |||
169 | SYSCALL(sys_sched_yield,sys_sched_yield,sys_sched_yield) | 169 | SYSCALL(sys_sched_yield,sys_sched_yield,sys_sched_yield) |
170 | SYSCALL(sys_sched_get_priority_max,sys_sched_get_priority_max,sys32_sched_get_priority_max_wrapper) | 170 | SYSCALL(sys_sched_get_priority_max,sys_sched_get_priority_max,sys32_sched_get_priority_max_wrapper) |
171 | SYSCALL(sys_sched_get_priority_min,sys_sched_get_priority_min,sys32_sched_get_priority_min_wrapper) /* 160 */ | 171 | SYSCALL(sys_sched_get_priority_min,sys_sched_get_priority_min,sys32_sched_get_priority_min_wrapper) /* 160 */ |
172 | SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,sys32_sched_rr_get_interval_wrapper) | 172 | SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval) |
173 | SYSCALL(sys_nanosleep,sys_nanosleep,compat_sys_nanosleep_wrapper) | 173 | SYSCALL(sys_nanosleep,sys_nanosleep,compat_sys_nanosleep_wrapper) |
174 | SYSCALL(sys_mremap,sys_mremap,sys32_mremap_wrapper) | 174 | SYSCALL(sys_mremap,sys_mremap,sys32_mremap_wrapper) |
175 | SYSCALL(sys_setresuid16,sys_ni_syscall,sys32_setresuid16_wrapper) /* old setresuid16 syscall */ | 175 | SYSCALL(sys_setresuid16,sys_ni_syscall,sys32_setresuid16_wrapper) /* old setresuid16 syscall */ |
@@ -182,19 +182,19 @@ SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper) /* 170 old set | |||
182 | SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */ | 182 | SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */ |
183 | SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper) | 183 | SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper) |
184 | SYSCALL(sys_rt_sigreturn,sys_rt_sigreturn,sys32_rt_sigreturn) | 184 | SYSCALL(sys_rt_sigreturn,sys_rt_sigreturn,sys32_rt_sigreturn) |
185 | SYSCALL(sys_rt_sigaction,sys_rt_sigaction,sys32_rt_sigaction_wrapper) | 185 | SYSCALL(sys_rt_sigaction,sys_rt_sigaction,compat_sys_rt_sigaction) |
186 | SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,sys32_rt_sigprocmask_wrapper) /* 175 */ | 186 | SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,compat_sys_rt_sigprocmask) /* 175 */ |
187 | SYSCALL(sys_rt_sigpending,sys_rt_sigpending,sys32_rt_sigpending_wrapper) | 187 | SYSCALL(sys_rt_sigpending,sys_rt_sigpending,compat_sys_rt_sigpending) |
188 | SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait_wrapper) | 188 | SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait) |
189 | SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,sys32_rt_sigqueueinfo_wrapper) | 189 | SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,compat_sys_rt_sigqueueinfo) |
190 | SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend_wrapper) | 190 | SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend) |
191 | SYSCALL(sys_pread64,sys_pread64,sys32_pread64_wrapper) /* 180 */ | 191 | SYSCALL(sys_pread64,sys_pread64,sys32_pread64_wrapper) /* 180 */ |
192 | SYSCALL(sys_pwrite64,sys_pwrite64,sys32_pwrite64_wrapper) | 192 | SYSCALL(sys_pwrite64,sys_pwrite64,sys32_pwrite64_wrapper) |
193 | SYSCALL(sys_chown16,sys_ni_syscall,sys32_chown16_wrapper) /* old chown16 syscall */ | 193 | SYSCALL(sys_chown16,sys_ni_syscall,sys32_chown16_wrapper) /* old chown16 syscall */ |
194 | SYSCALL(sys_getcwd,sys_getcwd,sys32_getcwd_wrapper) | 194 | SYSCALL(sys_getcwd,sys_getcwd,sys32_getcwd_wrapper) |
195 | SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper) | 195 | SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper) |
196 | SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper) /* 185 */ | 196 | SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper) /* 185 */ |
197 | SYSCALL(sys_sigaltstack,sys_sigaltstack,sys32_sigaltstack_wrapper) | 197 | SYSCALL(sys_sigaltstack,sys_sigaltstack,compat_sys_sigaltstack) |
198 | SYSCALL(sys_sendfile,sys_sendfile64,sys32_sendfile_wrapper) | 198 | SYSCALL(sys_sendfile,sys_sendfile64,sys32_sendfile_wrapper) |
199 | NI_SYSCALL /* streams1 */ | 199 | NI_SYSCALL /* streams1 */ |
200 | NI_SYSCALL /* streams2 */ | 200 | NI_SYSCALL /* streams2 */ |
@@ -246,7 +246,7 @@ SYSCALL(sys_lremovexattr,sys_lremovexattr,sys32_lremovexattr_wrapper) | |||
246 | SYSCALL(sys_fremovexattr,sys_fremovexattr,sys32_fremovexattr_wrapper) /* 235 */ | 246 | SYSCALL(sys_fremovexattr,sys_fremovexattr,sys32_fremovexattr_wrapper) /* 235 */ |
247 | SYSCALL(sys_gettid,sys_gettid,sys_gettid) | 247 | SYSCALL(sys_gettid,sys_gettid,sys_gettid) |
248 | SYSCALL(sys_tkill,sys_tkill,sys_tkill_wrapper) | 248 | SYSCALL(sys_tkill,sys_tkill,sys_tkill_wrapper) |
249 | SYSCALL(sys_futex,sys_futex,compat_sys_futex_wrapper) | 249 | SYSCALL(sys_futex,sys_futex,compat_sys_futex) |
250 | SYSCALL(sys_sched_setaffinity,sys_sched_setaffinity,sys32_sched_setaffinity_wrapper) | 250 | SYSCALL(sys_sched_setaffinity,sys_sched_setaffinity,sys32_sched_setaffinity_wrapper) |
251 | SYSCALL(sys_sched_getaffinity,sys_sched_getaffinity,sys32_sched_getaffinity_wrapper) /* 240 */ | 251 | SYSCALL(sys_sched_getaffinity,sys_sched_getaffinity,sys32_sched_getaffinity_wrapper) /* 240 */ |
252 | SYSCALL(sys_tgkill,sys_tgkill,sys_tgkill_wrapper) | 252 | SYSCALL(sys_tgkill,sys_tgkill,sys_tgkill_wrapper) |
@@ -289,14 +289,14 @@ SYSCALL(sys_kexec_load,sys_kexec_load,compat_sys_kexec_load_wrapper) | |||
289 | SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper) | 289 | SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper) |
290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) | 290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) |
291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl_wrapper) /* 280 */ | 291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl_wrapper) /* 280 */ |
292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper) | 292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid) |
293 | SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper) | 293 | SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper) |
294 | SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper) | 294 | SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper) |
295 | SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init) | 295 | SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init) |
296 | SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper) /* 285 */ | 296 | SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper) /* 285 */ |
297 | SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper) | 297 | SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper) |
298 | NI_SYSCALL /* 287 sys_migrate_pages */ | 298 | NI_SYSCALL /* 287 sys_migrate_pages */ |
299 | SYSCALL(sys_openat,sys_openat,compat_sys_openat_wrapper) | 299 | SYSCALL(sys_openat,sys_openat,compat_sys_openat) |
300 | SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper) | 300 | SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper) |
301 | SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ | 301 | SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ |
302 | SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) | 302 | SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) |
@@ -312,8 +312,8 @@ SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */ | |||
312 | SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper) | 312 | SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper) |
313 | SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper) | 313 | SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper) |
314 | SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper) | 314 | SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper) |
315 | SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list_wrapper) | 315 | SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list) |
316 | SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list_wrapper) | 316 | SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list) |
317 | SYSCALL(sys_splice,sys_splice,sys_splice_wrapper) | 317 | SYSCALL(sys_splice,sys_splice,sys_splice_wrapper) |
318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper) | 318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper) |
319 | SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) | 319 | SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) |
@@ -328,8 +328,8 @@ SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) | |||
328 | NI_SYSCALL /* 317 old sys_timer_fd */ | 328 | NI_SYSCALL /* 317 old sys_timer_fd */ |
329 | SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) | 329 | SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) |
330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) | 330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) |
331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime_wrapper) /* 320 */ | 331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */ |
332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime_wrapper) | 332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime) |
333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4_wrapper) | 333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4_wrapper) |
334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) | 334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) |
335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) | 335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) |
@@ -338,13 +338,13 @@ SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper) | |||
338 | SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) | 338 | SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) |
339 | SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper) | 339 | SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv_wrapper) |
340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) | 340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev_wrapper) |
341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo_wrapper) /* 330 */ | 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ |
342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) | 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) |
343 | SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper) | 343 | SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper) |
344 | SYSCALL(sys_fanotify_mark,sys_fanotify_mark,sys_fanotify_mark_wrapper) | 344 | SYSCALL(sys_fanotify_mark,sys_fanotify_mark,sys_fanotify_mark_wrapper) |
345 | SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) | 345 | SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) |
346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ | 346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ |
347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at_wrapper) | 347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at) |
348 | SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime_wrapper) | 348 | SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime_wrapper) |
349 | SYSCALL(sys_syncfs,sys_syncfs,sys_syncfs_wrapper) | 349 | SYSCALL(sys_syncfs,sys_syncfs,sys_syncfs_wrapper) |
350 | SYSCALL(sys_setns,sys_setns,sys_setns_wrapper) | 350 | SYSCALL(sys_setns,sys_setns,sys_setns_wrapper) |
diff --git a/arch/score/Kconfig b/arch/score/Kconfig index 3b1482e7afac..a125d7207bcc 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig | |||
@@ -14,6 +14,7 @@ config SCORE | |||
14 | select HAVE_MOD_ARCH_SPECIFIC | 14 | select HAVE_MOD_ARCH_SPECIFIC |
15 | select MODULES_USE_ELF_REL | 15 | select MODULES_USE_ELF_REL |
16 | select CLONE_BACKWARDS | 16 | select CLONE_BACKWARDS |
17 | select GENERIC_SIGALTSTACK | ||
17 | 18 | ||
18 | choice | 19 | choice |
19 | prompt "System type" | 20 | prompt "System type" |
diff --git a/arch/score/include/asm/syscalls.h b/arch/score/include/asm/syscalls.h index acaeed680956..98d1df92fbd1 100644 --- a/arch/score/include/asm/syscalls.h +++ b/arch/score/include/asm/syscalls.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_SCORE_SYSCALLS_H | 1 | #ifndef _ASM_SCORE_SYSCALLS_H |
2 | #define _ASM_SCORE_SYSCALLS_H | 2 | #define _ASM_SCORE_SYSCALLS_H |
3 | 3 | ||
4 | asmlinkage long score_sigaltstack(struct pt_regs *regs); | ||
5 | asmlinkage long score_rt_sigreturn(struct pt_regs *regs); | 4 | asmlinkage long score_rt_sigreturn(struct pt_regs *regs); |
6 | 5 | ||
7 | #include <asm-generic/syscalls.h> | 6 | #include <asm-generic/syscalls.h> |
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S index 1557ca1a2951..7234ed09b7b7 100644 --- a/arch/score/kernel/entry.S +++ b/arch/score/kernel/entry.S | |||
@@ -491,8 +491,3 @@ ENTRY(sys_rt_sigreturn) | |||
491 | mv r4, r0 | 491 | mv r4, r0 |
492 | la r8, score_rt_sigreturn | 492 | la r8, score_rt_sigreturn |
493 | br r8 | 493 | br r8 |
494 | |||
495 | ENTRY(sys_sigaltstack) | ||
496 | mv r4, r0 | ||
497 | la r8, score_sigaltstack | ||
498 | br r8 | ||
diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c index 02353bde92d8..a00fba32b0eb 100644 --- a/arch/score/kernel/signal.c +++ b/arch/score/kernel/signal.c | |||
@@ -134,16 +134,6 @@ static void __user *get_sigframe(struct k_sigaction *ka, | |||
134 | } | 134 | } |
135 | 135 | ||
136 | asmlinkage long | 136 | asmlinkage long |
137 | score_sigaltstack(struct pt_regs *regs) | ||
138 | { | ||
139 | const stack_t __user *uss = (const stack_t __user *) regs->regs[4]; | ||
140 | stack_t __user *uoss = (stack_t __user *) regs->regs[5]; | ||
141 | unsigned long usp = regs->regs[0]; | ||
142 | |||
143 | return do_sigaltstack(uss, uoss, usp); | ||
144 | } | ||
145 | |||
146 | asmlinkage long | ||
147 | score_rt_sigreturn(struct pt_regs *regs) | 137 | score_rt_sigreturn(struct pt_regs *regs) |
148 | { | 138 | { |
149 | struct rt_sigframe __user *frame; | 139 | struct rt_sigframe __user *frame; |
@@ -167,9 +157,7 @@ score_rt_sigreturn(struct pt_regs *regs) | |||
167 | else if (sig) | 157 | else if (sig) |
168 | force_sig(sig, current); | 158 | force_sig(sig, current); |
169 | 159 | ||
170 | /* It is more difficult to avoid calling this function than to | 160 | if (restore_altstack(&frame->rs_uc.uc_stack)) |
171 | call it and ignore errors. */ | ||
172 | if (do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs->regs[0]) == -EFAULT) | ||
173 | goto badframe; | 161 | goto badframe; |
174 | regs->is_syscall = 0; | 162 | regs->is_syscall = 0; |
175 | 163 | ||
@@ -209,12 +197,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
209 | err |= copy_siginfo_to_user(&frame->rs_info, info); | 197 | err |= copy_siginfo_to_user(&frame->rs_info, info); |
210 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 198 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
211 | err |= __put_user(NULL, &frame->rs_uc.uc_link); | 199 | err |= __put_user(NULL, &frame->rs_uc.uc_link); |
212 | err |= __put_user((void __user *)current->sas_ss_sp, | 200 | err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[0]); |
213 | &frame->rs_uc.uc_stack.ss_sp); | ||
214 | err |= __put_user(sas_ss_flags(regs->regs[0]), | ||
215 | &frame->rs_uc.uc_stack.ss_flags); | ||
216 | err |= __put_user(current->sas_ss_size, | ||
217 | &frame->rs_uc.uc_stack.ss_size); | ||
218 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); | 201 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); |
219 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); | 202 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); |
220 | 203 | ||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index babc2b826c5c..b5fd9f3c9925 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -40,6 +40,9 @@ config SUPERH | |||
40 | select GENERIC_STRNLEN_USER | 40 | select GENERIC_STRNLEN_USER |
41 | select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER | 41 | select HAVE_MOD_ARCH_SPECIFIC if DWARF_UNWINDER |
42 | select MODULES_USE_ELF_RELA | 42 | select MODULES_USE_ELF_RELA |
43 | select GENERIC_SIGALTSTACK | ||
44 | select OLD_SIGSUSPEND | ||
45 | select OLD_SIGACTION | ||
43 | help | 46 | help |
44 | The SuperH is a RISC processor targeted for use in embedded systems | 47 | The SuperH is a RISC processor targeted for use in embedded systems |
45 | and consumer electronics; it was also used in the Sega Dreamcast | 48 | and consumer electronics; it was also used in the Sega Dreamcast |
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h index cc25485996bb..4f97df87d7d5 100644 --- a/arch/sh/include/asm/syscalls_32.h +++ b/arch/sh/include/asm/syscalls_32.h | |||
@@ -9,12 +9,6 @@ | |||
9 | 9 | ||
10 | struct pt_regs; | 10 | struct pt_regs; |
11 | 11 | ||
12 | asmlinkage int sys_sigsuspend(old_sigset_t mask); | ||
13 | asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
14 | struct old_sigaction __user *oact); | ||
15 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
16 | unsigned long r6, unsigned long r7, | ||
17 | struct pt_regs __regs); | ||
18 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | 12 | asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, |
19 | unsigned long r6, unsigned long r7, | 13 | unsigned long r6, unsigned long r7, |
20 | struct pt_regs __regs); | 14 | struct pt_regs __regs); |
diff --git a/arch/sh/include/uapi/asm/signal.h b/arch/sh/include/uapi/asm/signal.h index 9ac530a90bce..cb96d02f55a4 100644 --- a/arch/sh/include/uapi/asm/signal.h +++ b/arch/sh/include/uapi/asm/signal.h | |||
@@ -5,11 +5,13 @@ | |||
5 | 5 | ||
6 | #include <asm-generic/signal.h> | 6 | #include <asm-generic/signal.h> |
7 | 7 | ||
8 | #ifndef __KERNEL__ | ||
8 | struct old_sigaction { | 9 | struct old_sigaction { |
9 | __sighandler_t sa_handler; | 10 | __sighandler_t sa_handler; |
10 | old_sigset_t sa_mask; | 11 | old_sigset_t sa_mask; |
11 | unsigned long sa_flags; | 12 | unsigned long sa_flags; |
12 | void (*sa_restorer)(void); | 13 | void (*sa_restorer)(void); |
13 | }; | 14 | }; |
15 | #endif | ||
14 | 16 | ||
15 | #endif /* __ASM_SH_SIGNAL_H */ | 17 | #endif /* __ASM_SH_SIGNAL_H */ |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 2f1f65356c0c..6af6e7c5cac8 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -47,60 +47,6 @@ struct fdpic_func_descriptor { | |||
47 | #define UNWINDGUARD 64 | 47 | #define UNWINDGUARD 64 |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Atomically swap in the new signal mask, and wait for a signal. | ||
51 | */ | ||
52 | asmlinkage int | ||
53 | sys_sigsuspend(old_sigset_t mask) | ||
54 | { | ||
55 | sigset_t blocked; | ||
56 | siginitset(&blocked, mask); | ||
57 | return sigsuspend(&blocked); | ||
58 | } | ||
59 | |||
60 | asmlinkage int | ||
61 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
62 | struct old_sigaction __user *oact) | ||
63 | { | ||
64 | struct k_sigaction new_ka, old_ka; | ||
65 | int ret; | ||
66 | |||
67 | if (act) { | ||
68 | old_sigset_t mask; | ||
69 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
70 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
71 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
72 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
73 | __get_user(mask, &act->sa_mask)) | ||
74 | return -EFAULT; | ||
75 | siginitset(&new_ka.sa.sa_mask, mask); | ||
76 | } | ||
77 | |||
78 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
79 | |||
80 | if (!ret && oact) { | ||
81 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
82 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
83 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
84 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
85 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
86 | return -EFAULT; | ||
87 | } | ||
88 | |||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | asmlinkage int | ||
93 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
94 | unsigned long r6, unsigned long r7, | ||
95 | struct pt_regs __regs) | ||
96 | { | ||
97 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
98 | |||
99 | return do_sigaltstack(uss, uoss, regs->regs[15]); | ||
100 | } | ||
101 | |||
102 | |||
103 | /* | ||
104 | * Do a signal return; undo the signal stack. | 50 | * Do a signal return; undo the signal stack. |
105 | */ | 51 | */ |
106 | 52 | ||
@@ -257,8 +203,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
257 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 203 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
258 | goto badframe; | 204 | goto badframe; |
259 | 205 | ||
260 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, | 206 | if (restore_altstack(&frame->uc.uc_stack)) |
261 | regs->regs[15]) == -EFAULT) | ||
262 | goto badframe; | 207 | goto badframe; |
263 | 208 | ||
264 | return r0; | 209 | return r0; |
@@ -423,11 +368,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
423 | /* Create the ucontext. */ | 368 | /* Create the ucontext. */ |
424 | err |= __put_user(0, &frame->uc.uc_flags); | 369 | err |= __put_user(0, &frame->uc.uc_flags); |
425 | err |= __put_user(NULL, &frame->uc.uc_link); | 370 | err |= __put_user(NULL, &frame->uc.uc_link); |
426 | err |= __put_user((void *)current->sas_ss_sp, | 371 | err |= __save_altstack(&frame->uc.uc_stack, regs->regs[15]); |
427 | &frame->uc.uc_stack.ss_sp); | ||
428 | err |= __put_user(sas_ss_flags(regs->regs[15]), | ||
429 | &frame->uc.uc_stack.ss_flags); | ||
430 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
431 | err |= setup_sigcontext(&frame->uc.uc_mcontext, | 372 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
432 | regs, set->sig[0]); | 373 | regs, set->sig[0]); |
433 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 374 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index d867cd95a622..23d4c71c91af 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -128,58 +128,6 @@ static void do_signal(struct pt_regs *regs) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | /* | 130 | /* |
131 | * Atomically swap in the new signal mask, and wait for a signal. | ||
132 | */ | ||
133 | asmlinkage int | ||
134 | sys_sigsuspend(old_sigset_t mask) | ||
135 | { | ||
136 | sigset_t blocked; | ||
137 | siginitset(&blocked, mask); | ||
138 | return sigsuspend(&blocked); | ||
139 | } | ||
140 | |||
141 | asmlinkage int | ||
142 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
143 | struct old_sigaction __user *oact) | ||
144 | { | ||
145 | struct k_sigaction new_ka, old_ka; | ||
146 | int ret; | ||
147 | |||
148 | if (act) { | ||
149 | old_sigset_t mask; | ||
150 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
151 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
152 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
153 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
154 | __get_user(mask, &act->sa_mask)) | ||
155 | return -EFAULT; | ||
156 | siginitset(&new_ka.sa.sa_mask, mask); | ||
157 | } | ||
158 | |||
159 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
160 | |||
161 | if (!ret && oact) { | ||
162 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
163 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
164 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
165 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
166 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
167 | return -EFAULT; | ||
168 | } | ||
169 | |||
170 | return ret; | ||
171 | } | ||
172 | |||
173 | asmlinkage int | ||
174 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
175 | unsigned long r4, unsigned long r5, unsigned long r6, | ||
176 | unsigned long r7, | ||
177 | struct pt_regs * regs) | ||
178 | { | ||
179 | return do_sigaltstack(uss, uoss, REF_REG_SP); | ||
180 | } | ||
181 | |||
182 | /* | ||
183 | * Do a signal return; undo the signal stack. | 131 | * Do a signal return; undo the signal stack. |
184 | */ | 132 | */ |
185 | struct sigframe { | 133 | struct sigframe { |
@@ -364,9 +312,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, | |||
364 | goto badframe; | 312 | goto badframe; |
365 | regs->pc -= 4; | 313 | regs->pc -= 4; |
366 | 314 | ||
367 | /* It is more difficult to avoid calling this function than to | 315 | if (restore_altstack(&frame->uc.uc_stack)) |
368 | call it and ignore errors. */ | ||
369 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, REF_REG_SP) == -EFAULT) | ||
370 | goto badframe; | 316 | goto badframe; |
371 | 317 | ||
372 | return (int) ret; | 318 | return (int) ret; |
@@ -560,11 +506,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
560 | /* Create the ucontext. */ | 506 | /* Create the ucontext. */ |
561 | err |= __put_user(0, &frame->uc.uc_flags); | 507 | err |= __put_user(0, &frame->uc.uc_flags); |
562 | err |= __put_user(0, &frame->uc.uc_link); | 508 | err |= __put_user(0, &frame->uc.uc_link); |
563 | err |= __put_user((void *)current->sas_ss_sp, | 509 | err |= __save_altstack(&frame->uc.uc_stack, regs->regs[REG_SP]); |
564 | &frame->uc.uc_stack.ss_sp); | ||
565 | err |= __put_user(sas_ss_flags(regs->regs[REG_SP]), | ||
566 | &frame->uc.uc_stack.ss_flags); | ||
567 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
568 | err |= setup_sigcontext(&frame->uc.uc_mcontext, | 510 | err |= setup_sigcontext(&frame->uc.uc_mcontext, |
569 | regs, set->sig[0]); | 511 | regs, set->sig[0]); |
570 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 512 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 89dde2f0653a..e557b0821540 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -42,12 +42,19 @@ config SPARC | |||
42 | select GENERIC_STRNLEN_USER | 42 | select GENERIC_STRNLEN_USER |
43 | select MODULES_USE_ELF_RELA | 43 | select MODULES_USE_ELF_RELA |
44 | select ODD_RT_SIGACTION | 44 | select ODD_RT_SIGACTION |
45 | select GENERIC_SIGALTSTACK | ||
46 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
47 | select GENERIC_COMPAT_RT_SIGPROCMASK | ||
48 | select GENERIC_COMPAT_RT_SIGPENDING | ||
49 | select GENERIC_COMPAT_RT_SIGACTION | ||
50 | select OLD_SIGSUSPEND | ||
45 | 51 | ||
46 | config SPARC32 | 52 | config SPARC32 |
47 | def_bool !64BIT | 53 | def_bool !64BIT |
48 | select GENERIC_ATOMIC64 | 54 | select GENERIC_ATOMIC64 |
49 | select CLZ_TAB | 55 | select CLZ_TAB |
50 | select HAVE_UID16 | 56 | select HAVE_UID16 |
57 | select OLD_SIGACTION | ||
51 | 58 | ||
52 | config SPARC64 | 59 | config SPARC64 |
53 | def_bool 64BIT | 60 | def_bool 64BIT |
@@ -544,6 +551,7 @@ config COMPAT | |||
544 | select COMPAT_BINFMT_ELF | 551 | select COMPAT_BINFMT_ELF |
545 | select HAVE_UID16 | 552 | select HAVE_UID16 |
546 | select ARCH_WANT_OLD_COMPAT_IPC | 553 | select ARCH_WANT_OLD_COMPAT_IPC |
554 | select COMPAT_OLD_SIGACTION | ||
547 | 555 | ||
548 | config SYSVIPC_COMPAT | 556 | config SYSVIPC_COMPAT |
549 | bool | 557 | bool |
diff --git a/arch/sparc/include/asm/compat_signal.h b/arch/sparc/include/asm/compat_signal.h index b759eab9b51c..9ed1f128b4d1 100644 --- a/arch/sparc/include/asm/compat_signal.h +++ b/arch/sparc/include/asm/compat_signal.h | |||
@@ -18,12 +18,6 @@ struct __old_sigaction32 { | |||
18 | unsigned int sa_flags; | 18 | unsigned int sa_flags; |
19 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | 19 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ |
20 | }; | 20 | }; |
21 | |||
22 | typedef struct sigaltstack32 { | ||
23 | u32 ss_sp; | ||
24 | int ss_flags; | ||
25 | compat_size_t ss_size; | ||
26 | } stack_t32; | ||
27 | #endif | 21 | #endif |
28 | 22 | ||
29 | #endif /* !(_COMPAT_SIGNAL_H) */ | 23 | #endif /* !(_COMPAT_SIGNAL_H) */ |
diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h index 284836f0b7dc..f387400fcfdf 100644 --- a/arch/sparc/include/uapi/asm/signal.h +++ b/arch/sparc/include/uapi/asm/signal.h | |||
@@ -160,7 +160,6 @@ struct __new_sigaction { | |||
160 | __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */ | 160 | __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */ |
161 | __new_sigset_t sa_mask; | 161 | __new_sigset_t sa_mask; |
162 | }; | 162 | }; |
163 | #endif | ||
164 | 163 | ||
165 | struct __old_sigaction { | 164 | struct __old_sigaction { |
166 | __sighandler_t sa_handler; | 165 | __sighandler_t sa_handler; |
@@ -168,6 +167,7 @@ struct __old_sigaction { | |||
168 | unsigned long sa_flags; | 167 | unsigned long sa_flags; |
169 | void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ | 168 | void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ |
170 | }; | 169 | }; |
170 | #endif | ||
171 | 171 | ||
172 | typedef struct sigaltstack { | 172 | typedef struct sigaltstack { |
173 | void __user *ss_sp; | 173 | void __user *ss_sp; |
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 21fd1a8f47d2..e2a030045089 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S | |||
@@ -820,14 +820,6 @@ sys_sparc_pipe: | |||
820 | mov %l5, %o7 | 820 | mov %l5, %o7 |
821 | 821 | ||
822 | .align 4 | 822 | .align 4 |
823 | .globl sys_sigaltstack | ||
824 | sys_sigaltstack: | ||
825 | mov %o7, %l5 | ||
826 | mov %fp, %o2 | ||
827 | call do_sigaltstack | ||
828 | mov %l5, %o7 | ||
829 | |||
830 | .align 4 | ||
831 | .globl sys_sigstack | 823 | .globl sys_sigstack |
832 | sys_sigstack: | 824 | sys_sigstack: |
833 | mov %o7, %l5 | 825 | mov %o7, %l5 |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 53e48f721ce3..9d9eb91d0de1 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -61,7 +61,7 @@ struct rt_signal_frame32 { | |||
61 | compat_sigset_t mask; | 61 | compat_sigset_t mask; |
62 | /* __siginfo_fpu_t * */ u32 fpu_save; | 62 | /* __siginfo_fpu_t * */ u32 fpu_save; |
63 | unsigned int insns[2]; | 63 | unsigned int insns[2]; |
64 | stack_t32 stack; | 64 | compat_stack_t stack; |
65 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ | 65 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ |
66 | /* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ | 66 | /* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ |
67 | siginfo_extra_v8plus_t v8plus; | 67 | siginfo_extra_v8plus_t v8plus; |
@@ -230,13 +230,11 @@ segv: | |||
230 | asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | 230 | asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) |
231 | { | 231 | { |
232 | struct rt_signal_frame32 __user *sf; | 232 | struct rt_signal_frame32 __user *sf; |
233 | unsigned int psr, pc, npc, u_ss_sp; | 233 | unsigned int psr, pc, npc; |
234 | compat_uptr_t fpu_save; | 234 | compat_uptr_t fpu_save; |
235 | compat_uptr_t rwin_save; | 235 | compat_uptr_t rwin_save; |
236 | mm_segment_t old_fs; | ||
237 | sigset_t set; | 236 | sigset_t set; |
238 | compat_sigset_t seta; | 237 | compat_sigset_t seta; |
239 | stack_t st; | ||
240 | int err, i; | 238 | int err, i; |
241 | 239 | ||
242 | /* Always make any pending restarted system calls return -EINTR */ | 240 | /* Always make any pending restarted system calls return -EINTR */ |
@@ -295,20 +293,10 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | |||
295 | if (!err && fpu_save) | 293 | if (!err && fpu_save) |
296 | err |= restore_fpu_state(regs, compat_ptr(fpu_save)); | 294 | err |= restore_fpu_state(regs, compat_ptr(fpu_save)); |
297 | err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); | 295 | err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); |
298 | err |= __get_user(u_ss_sp, &sf->stack.ss_sp); | 296 | err |= compat_restore_altstack(&sf->stack); |
299 | st.ss_sp = compat_ptr(u_ss_sp); | ||
300 | err |= __get_user(st.ss_flags, &sf->stack.ss_flags); | ||
301 | err |= __get_user(st.ss_size, &sf->stack.ss_size); | ||
302 | if (err) | 297 | if (err) |
303 | goto segv; | 298 | goto segv; |
304 | 299 | ||
305 | /* It is more difficult to avoid calling this function than to | ||
306 | call it and ignore errors. */ | ||
307 | old_fs = get_fs(); | ||
308 | set_fs(KERNEL_DS); | ||
309 | do_sigaltstack((stack_t __user *) &st, NULL, (unsigned long)sf); | ||
310 | set_fs(old_fs); | ||
311 | |||
312 | err |= __get_user(rwin_save, &sf->rwin_save); | 300 | err |= __get_user(rwin_save, &sf->rwin_save); |
313 | if (!err && rwin_save) { | 301 | if (!err && rwin_save) { |
314 | if (restore_rwin_state(compat_ptr(rwin_save))) | 302 | if (restore_rwin_state(compat_ptr(rwin_save))) |
@@ -642,9 +630,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
642 | err |= copy_siginfo_to_user32(&sf->info, info); | 630 | err |= copy_siginfo_to_user32(&sf->info, info); |
643 | 631 | ||
644 | /* Setup sigaltstack */ | 632 | /* Setup sigaltstack */ |
645 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); | 633 | err |= __compat_save_altstack(&sf->stack, regs->u_regs[UREG_FP]); |
646 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); | ||
647 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); | ||
648 | 634 | ||
649 | switch (_NSIG_WORDS) { | 635 | switch (_NSIG_WORDS) { |
650 | case 4: seta.sig[7] = (oldset->sig[3] >> 32); | 636 | case 4: seta.sig[7] = (oldset->sig[3] >> 32); |
@@ -856,29 +842,3 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp) | |||
856 | out: | 842 | out: |
857 | return ret; | 843 | return ret; |
858 | } | 844 | } |
859 | |||
860 | asmlinkage long do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp) | ||
861 | { | ||
862 | stack_t uss, uoss; | ||
863 | u32 u_ss_sp = 0; | ||
864 | int ret; | ||
865 | mm_segment_t old_fs; | ||
866 | stack_t32 __user *uss32 = compat_ptr(ussa); | ||
867 | stack_t32 __user *uoss32 = compat_ptr(uossa); | ||
868 | |||
869 | if (ussa && (get_user(u_ss_sp, &uss32->ss_sp) || | ||
870 | __get_user(uss.ss_flags, &uss32->ss_flags) || | ||
871 | __get_user(uss.ss_size, &uss32->ss_size))) | ||
872 | return -EFAULT; | ||
873 | uss.ss_sp = compat_ptr(u_ss_sp); | ||
874 | old_fs = get_fs(); | ||
875 | set_fs(KERNEL_DS); | ||
876 | ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL, | ||
877 | uossa ? (stack_t __user *) &uoss : NULL, sp); | ||
878 | set_fs(old_fs); | ||
879 | if (!ret && uossa && (put_user(ptr_to_compat(uoss.ss_sp), &uoss32->ss_sp) || | ||
880 | __put_user(uoss.ss_flags, &uoss32->ss_flags) || | ||
881 | __put_user(uoss.ss_size, &uoss32->ss_size))) | ||
882 | return -EFAULT; | ||
883 | return ret; | ||
884 | } | ||
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 68f9c8650af4..cd1823487759 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -59,18 +59,6 @@ struct rt_signal_frame { | |||
59 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) | 59 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) |
60 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7))) | 60 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7))) |
61 | 61 | ||
62 | static int _sigpause_common(old_sigset_t set) | ||
63 | { | ||
64 | sigset_t blocked; | ||
65 | siginitset(&blocked, set); | ||
66 | return sigsuspend(&blocked); | ||
67 | } | ||
68 | |||
69 | asmlinkage int sys_sigsuspend(old_sigset_t set) | ||
70 | { | ||
71 | return _sigpause_common(set); | ||
72 | } | ||
73 | |||
74 | asmlinkage void do_sigreturn(struct pt_regs *regs) | 62 | asmlinkage void do_sigreturn(struct pt_regs *regs) |
75 | { | 63 | { |
76 | struct signal_frame __user *sf; | 64 | struct signal_frame __user *sf; |
@@ -141,9 +129,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
141 | unsigned int psr, pc, npc; | 129 | unsigned int psr, pc, npc; |
142 | __siginfo_fpu_t __user *fpu_save; | 130 | __siginfo_fpu_t __user *fpu_save; |
143 | __siginfo_rwin_t __user *rwin_save; | 131 | __siginfo_rwin_t __user *rwin_save; |
144 | mm_segment_t old_fs; | ||
145 | sigset_t set; | 132 | sigset_t set; |
146 | stack_t st; | ||
147 | int err; | 133 | int err; |
148 | 134 | ||
149 | synchronize_user_stack(); | 135 | synchronize_user_stack(); |
@@ -171,8 +157,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
171 | if (!err && fpu_save) | 157 | if (!err && fpu_save) |
172 | err |= restore_fpu_state(regs, fpu_save); | 158 | err |= restore_fpu_state(regs, fpu_save); |
173 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); | 159 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); |
174 | 160 | err |= restore_altstack(&sf->stack); | |
175 | err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t)); | ||
176 | 161 | ||
177 | if (err) | 162 | if (err) |
178 | goto segv; | 163 | goto segv; |
@@ -180,14 +165,6 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
180 | regs->pc = pc; | 165 | regs->pc = pc; |
181 | regs->npc = npc; | 166 | regs->npc = npc; |
182 | 167 | ||
183 | /* It is more difficult to avoid calling this function than to | ||
184 | * call it and ignore errors. | ||
185 | */ | ||
186 | old_fs = get_fs(); | ||
187 | set_fs(KERNEL_DS); | ||
188 | do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf); | ||
189 | set_fs(old_fs); | ||
190 | |||
191 | err |= __get_user(rwin_save, &sf->rwin_save); | 168 | err |= __get_user(rwin_save, &sf->rwin_save); |
192 | if (!err && rwin_save) { | 169 | if (!err && rwin_save) { |
193 | if (restore_rwin_state(rwin_save)) | 170 | if (restore_rwin_state(rwin_save)) |
@@ -391,9 +368,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
391 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); | 368 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); |
392 | 369 | ||
393 | /* Setup sigaltstack */ | 370 | /* Setup sigaltstack */ |
394 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); | 371 | err |= __save_altstack(&sf->stack, regs->u_regs[UREG_FP]); |
395 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); | ||
396 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); | ||
397 | 372 | ||
398 | if (!wsaved) { | 373 | if (!wsaved) { |
399 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], | 374 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 689e1ba62809..165a897a4133 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -236,23 +236,6 @@ struct rt_signal_frame { | |||
236 | __siginfo_rwin_t *rwin_save; | 236 | __siginfo_rwin_t *rwin_save; |
237 | }; | 237 | }; |
238 | 238 | ||
239 | static long _sigpause_common(old_sigset_t set) | ||
240 | { | ||
241 | sigset_t blocked; | ||
242 | siginitset(&blocked, set); | ||
243 | return sigsuspend(&blocked); | ||
244 | } | ||
245 | |||
246 | asmlinkage long sys_sigpause(unsigned int set) | ||
247 | { | ||
248 | return _sigpause_common(set); | ||
249 | } | ||
250 | |||
251 | asmlinkage long sys_sigsuspend(old_sigset_t set) | ||
252 | { | ||
253 | return _sigpause_common(set); | ||
254 | } | ||
255 | |||
256 | void do_rt_sigreturn(struct pt_regs *regs) | 239 | void do_rt_sigreturn(struct pt_regs *regs) |
257 | { | 240 | { |
258 | struct rt_signal_frame __user *sf; | 241 | struct rt_signal_frame __user *sf; |
@@ -295,7 +278,8 @@ void do_rt_sigreturn(struct pt_regs *regs) | |||
295 | err |= restore_fpu_state(regs, fpu_save); | 278 | err |= restore_fpu_state(regs, fpu_save); |
296 | 279 | ||
297 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); | 280 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); |
298 | if (err || do_sigaltstack(&sf->stack, NULL, (unsigned long)sf) == -EFAULT) | 281 | err |= restore_altstack(&sf->stack); |
282 | if (err) | ||
299 | goto segv; | 283 | goto segv; |
300 | 284 | ||
301 | err |= __get_user(rwin_save, &sf->rwin_save); | 285 | err |= __get_user(rwin_save, &sf->rwin_save); |
@@ -403,9 +387,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
403 | } | 387 | } |
404 | 388 | ||
405 | /* Setup sigaltstack */ | 389 | /* Setup sigaltstack */ |
406 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); | 390 | err |= __save_altstack(&sf->stack, regs->u_regs[UREG_FP]); |
407 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); | ||
408 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); | ||
409 | 391 | ||
410 | err |= copy_to_user(&sf->mask, oldset, sizeof(sigset_t)); | 392 | err |= copy_to_user(&sf->mask, oldset, sizeof(sigset_t)); |
411 | 393 | ||
diff --git a/arch/sparc/kernel/sys32.S b/arch/sparc/kernel/sys32.S index 8475a474273a..240a3cecc11e 100644 --- a/arch/sparc/kernel/sys32.S +++ b/arch/sparc/kernel/sys32.S | |||
@@ -36,108 +36,22 @@ STUB: sra REG1, 0, REG1; \ | |||
36 | jmpl %g1 + %lo(SYSCALL), %g0; \ | 36 | jmpl %g1 + %lo(SYSCALL), %g0; \ |
37 | sra REG3, 0, REG3 | 37 | sra REG3, 0, REG3 |
38 | 38 | ||
39 | #define SIGN4(STUB,SYSCALL,REG1,REG2,REG3,REG4) \ | ||
40 | .align 32; \ | ||
41 | .globl STUB; \ | ||
42 | STUB: sra REG1, 0, REG1; \ | ||
43 | sethi %hi(SYSCALL), %g1; \ | ||
44 | sra REG2, 0, REG2; \ | ||
45 | sra REG3, 0, REG3; \ | ||
46 | jmpl %g1 + %lo(SYSCALL), %g0; \ | ||
47 | sra REG4, 0, REG4 | ||
48 | |||
49 | SIGN1(sys32_exit, sparc_exit, %o0) | ||
50 | SIGN1(sys32_exit_group, sparc_exit_group, %o0) | ||
51 | SIGN1(sys32_wait4, compat_sys_wait4, %o2) | ||
52 | SIGN1(sys32_creat, sys_creat, %o1) | ||
53 | SIGN1(sys32_mknod, sys_mknod, %o1) | ||
54 | SIGN1(sys32_umount, sys_umount, %o1) | ||
55 | SIGN1(sys32_signal, sys_signal, %o0) | ||
56 | SIGN1(sys32_access, sys_access, %o1) | ||
57 | SIGN1(sys32_msync, sys_msync, %o2) | ||
58 | SIGN2(sys32_reboot, sys_reboot, %o0, %o1) | ||
59 | SIGN1(sys32_setitimer, compat_sys_setitimer, %o0) | ||
60 | SIGN1(sys32_getitimer, compat_sys_getitimer, %o0) | ||
61 | SIGN1(sys32_sethostname, sys_sethostname, %o1) | ||
62 | SIGN1(sys32_swapon, sys_swapon, %o1) | ||
63 | SIGN1(sys32_sigaction, compat_sys_sigaction, %o0) | ||
64 | SIGN1(sys32_rt_sigaction, compat_sys_rt_sigaction, %o0) | ||
65 | SIGN1(sys32_sigprocmask, compat_sys_sigprocmask, %o0) | ||
66 | SIGN1(sys32_rt_sigprocmask, compat_sys_rt_sigprocmask, %o0) | ||
67 | SIGN2(sys32_rt_sigqueueinfo, compat_sys_rt_sigqueueinfo, %o0, %o1) | ||
68 | SIGN1(sys32_getrusage, compat_sys_getrusage, %o0) | 39 | SIGN1(sys32_getrusage, compat_sys_getrusage, %o0) |
69 | SIGN1(sys32_setxattr, sys_setxattr, %o4) | ||
70 | SIGN1(sys32_lsetxattr, sys_lsetxattr, %o4) | ||
71 | SIGN1(sys32_fsetxattr, sys_fsetxattr, %o4) | ||
72 | SIGN1(sys32_fgetxattr, sys_fgetxattr, %o0) | ||
73 | SIGN1(sys32_flistxattr, sys_flistxattr, %o0) | ||
74 | SIGN1(sys32_fremovexattr, sys_fremovexattr, %o0) | ||
75 | SIGN2(sys32_tkill, sys_tkill, %o0, %o1) | ||
76 | SIGN1(sys32_epoll_create, sys_epoll_create, %o0) | ||
77 | SIGN3(sys32_epoll_ctl, sys_epoll_ctl, %o0, %o1, %o2) | ||
78 | SIGN3(sys32_epoll_wait, sys_epoll_wait, %o0, %o2, %o3) | ||
79 | SIGN1(sys32_readahead, compat_sys_readahead, %o0) | 40 | SIGN1(sys32_readahead, compat_sys_readahead, %o0) |
80 | SIGN2(sys32_fadvise64, compat_sys_fadvise64, %o0, %o4) | 41 | SIGN2(sys32_fadvise64, compat_sys_fadvise64, %o0, %o4) |
81 | SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) | 42 | SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) |
82 | SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) | ||
83 | SIGN1(sys32_mlockall, sys_mlockall, %o0) | ||
84 | SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) | 43 | SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) |
85 | SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) | 44 | SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) |
86 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) | 45 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) |
87 | SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) | 46 | SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) |
88 | SIGN1(sys32_select, compat_sys_select, %o0) | 47 | SIGN1(sys32_select, compat_sys_select, %o0) |
89 | SIGN1(sys32_mkdir, sys_mkdir, %o1) | ||
90 | SIGN3(sys32_futex, compat_sys_futex, %o1, %o2, %o5) | 48 | SIGN3(sys32_futex, compat_sys_futex, %o1, %o2, %o5) |
91 | SIGN1(sys32_sysfs, compat_sys_sysfs, %o0) | ||
92 | SIGN2(sys32_sendfile, compat_sys_sendfile, %o0, %o1) | 49 | SIGN2(sys32_sendfile, compat_sys_sendfile, %o0, %o1) |
93 | SIGN2(sys32_sendfile64, sys_sendfile, %o0, %o1) | ||
94 | SIGN1(sys32_prctl, sys_prctl, %o0) | ||
95 | SIGN1(sys32_sched_rr_get_interval, compat_sys_sched_rr_get_interval, %o0) | ||
96 | SIGN2(sys32_waitpid, sys_waitpid, %o0, %o2) | ||
97 | SIGN1(sys32_getgroups, sys_getgroups, %o0) | ||
98 | SIGN1(sys32_getpgid, sys_getpgid, %o0) | ||
99 | SIGN2(sys32_getpriority, sys_getpriority, %o0, %o1) | ||
100 | SIGN1(sys32_getsid, sys_getsid, %o0) | ||
101 | SIGN2(sys32_kill, sys_kill, %o0, %o1) | ||
102 | SIGN1(sys32_nice, sys_nice, %o0) | ||
103 | SIGN1(sys32_lseek, sys_lseek, %o1) | ||
104 | SIGN2(sys32_open, sparc32_open, %o1, %o2) | ||
105 | SIGN1(sys32_readlink, sys_readlink, %o2) | ||
106 | SIGN1(sys32_sched_get_priority_max, sys_sched_get_priority_max, %o0) | ||
107 | SIGN1(sys32_sched_get_priority_min, sys_sched_get_priority_min, %o0) | ||
108 | SIGN1(sys32_sched_getparam, sys_sched_getparam, %o0) | ||
109 | SIGN1(sys32_sched_getscheduler, sys_sched_getscheduler, %o0) | ||
110 | SIGN1(sys32_sched_setparam, sys_sched_setparam, %o0) | ||
111 | SIGN2(sys32_sched_setscheduler, sys_sched_setscheduler, %o0, %o1) | ||
112 | SIGN1(sys32_getdomainname, sys_getdomainname, %o1) | ||
113 | SIGN1(sys32_setdomainname, sys_setdomainname, %o1) | ||
114 | SIGN1(sys32_setgroups, sys_setgroups, %o0) | ||
115 | SIGN2(sys32_setpgid, sys_setpgid, %o0, %o1) | ||
116 | SIGN3(sys32_setpriority, sys_setpriority, %o0, %o1, %o2) | ||
117 | SIGN1(sys32_ssetmask, sys_ssetmask, %o0) | ||
118 | SIGN2(sys32_syslog, sys_syslog, %o0, %o2) | ||
119 | SIGN1(sys32_umask, sys_umask, %o0) | ||
120 | SIGN3(sys32_tgkill, sys_tgkill, %o0, %o1, %o2) | ||
121 | SIGN1(sys32_sendto, sys_sendto, %o0) | ||
122 | SIGN1(sys32_recvfrom, compat_sys_recvfrom, %o0) | 50 | SIGN1(sys32_recvfrom, compat_sys_recvfrom, %o0) |
123 | SIGN3(sys32_socket, sys_socket, %o0, %o1, %o2) | ||
124 | SIGN2(sys32_connect, sys_connect, %o0, %o2) | ||
125 | SIGN2(sys32_bind, sys_bind, %o0, %o2) | ||
126 | SIGN2(sys32_listen, sys_listen, %o0, %o1) | ||
127 | SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0) | 51 | SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0) |
128 | SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0) | 52 | SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0) |
129 | SIGN2(sys32_shutdown, sys_shutdown, %o0, %o1) | ||
130 | SIGN3(sys32_socketpair, sys_socketpair, %o0, %o1, %o2) | ||
131 | SIGN1(sys32_getpeername, sys_getpeername, %o0) | ||
132 | SIGN1(sys32_getsockname, sys_getsockname, %o0) | ||
133 | SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1) | ||
134 | SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2) | ||
135 | SIGN2(sys32_splice, sys_splice, %o0, %o2) | ||
136 | SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5) | 53 | SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5) |
137 | SIGN2(sys32_tee, sys_tee, %o0, %o1) | ||
138 | SIGN1(sys32_vmsplice, compat_sys_vmsplice, %o0) | 54 | SIGN1(sys32_vmsplice, compat_sys_vmsplice, %o0) |
139 | SIGN1(sys32_truncate, sys_truncate, %o1) | ||
140 | SIGN1(sys32_ftruncate, sys_ftruncate, %o1) | ||
141 | 55 | ||
142 | .globl sys32_mmap2 | 56 | .globl sys32_mmap2 |
143 | sys32_mmap2: | 57 | sys32_mmap2: |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index 4a4cdc633f6b..f38f2280fade 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
@@ -206,133 +206,19 @@ asmlinkage long compat_sys_fstatat64(unsigned int dfd, | |||
206 | return cp_compat_stat64(&stat, statbuf); | 206 | return cp_compat_stat64(&stat, statbuf); |
207 | } | 207 | } |
208 | 208 | ||
209 | asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2) | 209 | COMPAT_SYSCALL_DEFINE3(sparc_sigaction, int, sig, |
210 | struct compat_old_sigaction __user *,act, | ||
211 | struct compat_old_sigaction __user *,oact) | ||
210 | { | 212 | { |
211 | return sys_sysfs(option, arg1, arg2); | ||
212 | } | ||
213 | |||
214 | asmlinkage long compat_sys_rt_sigprocmask(int how, | ||
215 | compat_sigset_t __user *set, | ||
216 | compat_sigset_t __user *oset, | ||
217 | compat_size_t sigsetsize) | ||
218 | { | ||
219 | sigset_t s; | ||
220 | compat_sigset_t s32; | ||
221 | int ret; | ||
222 | mm_segment_t old_fs = get_fs(); | ||
223 | |||
224 | if (set) { | ||
225 | if (copy_from_user (&s32, set, sizeof(compat_sigset_t))) | ||
226 | return -EFAULT; | ||
227 | switch (_NSIG_WORDS) { | ||
228 | case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32); | ||
229 | case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32); | ||
230 | case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32); | ||
231 | case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); | ||
232 | } | ||
233 | } | ||
234 | set_fs (KERNEL_DS); | ||
235 | ret = sys_rt_sigprocmask(how, | ||
236 | set ? (sigset_t __user *) &s : NULL, | ||
237 | oset ? (sigset_t __user *) &s : NULL, | ||
238 | sigsetsize); | ||
239 | set_fs (old_fs); | ||
240 | if (ret) return ret; | ||
241 | if (oset) { | ||
242 | switch (_NSIG_WORDS) { | ||
243 | case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3]; | ||
244 | case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2]; | ||
245 | case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; | ||
246 | case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; | ||
247 | } | ||
248 | if (copy_to_user (oset, &s32, sizeof(compat_sigset_t))) | ||
249 | return -EFAULT; | ||
250 | } | ||
251 | return 0; | ||
252 | } | ||
253 | |||
254 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, | ||
255 | compat_size_t sigsetsize) | ||
256 | { | ||
257 | sigset_t s; | ||
258 | compat_sigset_t s32; | ||
259 | int ret; | ||
260 | mm_segment_t old_fs = get_fs(); | ||
261 | |||
262 | set_fs (KERNEL_DS); | ||
263 | ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize); | ||
264 | set_fs (old_fs); | ||
265 | if (!ret) { | ||
266 | switch (_NSIG_WORDS) { | ||
267 | case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3]; | ||
268 | case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2]; | ||
269 | case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; | ||
270 | case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; | ||
271 | } | ||
272 | if (copy_to_user (set, &s32, sizeof(compat_sigset_t))) | ||
273 | return -EFAULT; | ||
274 | } | ||
275 | return ret; | ||
276 | } | ||
277 | |||
278 | asmlinkage long compat_sys_rt_sigqueueinfo(int pid, int sig, | ||
279 | struct compat_siginfo __user *uinfo) | ||
280 | { | ||
281 | siginfo_t info; | ||
282 | int ret; | ||
283 | mm_segment_t old_fs = get_fs(); | ||
284 | |||
285 | if (copy_siginfo_from_user32(&info, uinfo)) | ||
286 | return -EFAULT; | ||
287 | |||
288 | set_fs (KERNEL_DS); | ||
289 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info); | ||
290 | set_fs (old_fs); | ||
291 | return ret; | ||
292 | } | ||
293 | |||
294 | asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act, | ||
295 | struct old_sigaction32 __user *oact) | ||
296 | { | ||
297 | struct k_sigaction new_ka, old_ka; | ||
298 | int ret; | ||
299 | |||
300 | WARN_ON_ONCE(sig >= 0); | 213 | WARN_ON_ONCE(sig >= 0); |
301 | sig = -sig; | 214 | return compat_sys_sigaction(-sig, act, oact); |
302 | |||
303 | if (act) { | ||
304 | compat_old_sigset_t mask; | ||
305 | u32 u_handler, u_restorer; | ||
306 | |||
307 | ret = get_user(u_handler, &act->sa_handler); | ||
308 | new_ka.sa.sa_handler = compat_ptr(u_handler); | ||
309 | ret |= __get_user(u_restorer, &act->sa_restorer); | ||
310 | new_ka.sa.sa_restorer = compat_ptr(u_restorer); | ||
311 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | ||
312 | ret |= __get_user(mask, &act->sa_mask); | ||
313 | if (ret) | ||
314 | return ret; | ||
315 | new_ka.ka_restorer = NULL; | ||
316 | siginitset(&new_ka.sa.sa_mask, mask); | ||
317 | } | ||
318 | |||
319 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
320 | |||
321 | if (!ret && oact) { | ||
322 | ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); | ||
323 | ret |= __put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer); | ||
324 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | ||
325 | ret |= __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
326 | } | ||
327 | |||
328 | return ret; | ||
329 | } | 215 | } |
330 | 216 | ||
331 | asmlinkage long compat_sys_rt_sigaction(int sig, | 217 | COMPAT_SYSCALL_DEFINE5(rt_sigaction, int, sig, |
332 | struct sigaction32 __user *act, | 218 | struct compat_sigaction __user *,act, |
333 | struct sigaction32 __user *oact, | 219 | struct compat_sigaction __user *,oact, |
334 | void __user *restorer, | 220 | void __user *,restorer, |
335 | compat_size_t sigsetsize) | 221 | compat_size_t,sigsetsize) |
336 | { | 222 | { |
337 | struct k_sigaction new_ka, old_ka; | 223 | struct k_sigaction new_ka, old_ka; |
338 | int ret; | 224 | int ret; |
@@ -349,12 +235,7 @@ asmlinkage long compat_sys_rt_sigaction(int sig, | |||
349 | ret = get_user(u_handler, &act->sa_handler); | 235 | ret = get_user(u_handler, &act->sa_handler); |
350 | new_ka.sa.sa_handler = compat_ptr(u_handler); | 236 | new_ka.sa.sa_handler = compat_ptr(u_handler); |
351 | ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)); | 237 | ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)); |
352 | switch (_NSIG_WORDS) { | 238 | sigset_from_compat(&new_ka.sa.sa_mask, &set32); |
353 | case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); | ||
354 | case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4] | (((long)set32.sig[5]) << 32); | ||
355 | case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2] | (((long)set32.sig[3]) << 32); | ||
356 | case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0] | (((long)set32.sig[1]) << 32); | ||
357 | } | ||
358 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); | 239 | ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); |
359 | ret |= __get_user(u_restorer, &act->sa_restorer); | 240 | ret |= __get_user(u_restorer, &act->sa_restorer); |
360 | new_ka.sa.sa_restorer = compat_ptr(u_restorer); | 241 | new_ka.sa.sa_restorer = compat_ptr(u_restorer); |
@@ -365,12 +246,7 @@ asmlinkage long compat_sys_rt_sigaction(int sig, | |||
365 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | 246 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); |
366 | 247 | ||
367 | if (!ret && oact) { | 248 | if (!ret && oact) { |
368 | switch (_NSIG_WORDS) { | 249 | sigset_to_compat(&set32, &old_ka.sa.sa_mask); |
369 | case 4: set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32); set32.sig[6] = old_ka.sa.sa_mask.sig[3]; | ||
370 | case 3: set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32); set32.sig[4] = old_ka.sa.sa_mask.sig[2]; | ||
371 | case 2: set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32); set32.sig[2] = old_ka.sa.sa_mask.sig[1]; | ||
372 | case 1: set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); set32.sig[0] = old_ka.sa.sa_mask.sig[0]; | ||
373 | } | ||
374 | ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); | 250 | ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler); |
375 | ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)); | 251 | ret |= __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)); |
376 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | 252 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); |
@@ -382,35 +258,6 @@ asmlinkage long compat_sys_rt_sigaction(int sig, | |||
382 | return ret; | 258 | return ret; |
383 | } | 259 | } |
384 | 260 | ||
385 | #ifdef CONFIG_MODULES | ||
386 | |||
387 | asmlinkage long sys32_init_module(void __user *umod, u32 len, | ||
388 | const char __user *uargs) | ||
389 | { | ||
390 | return sys_init_module(umod, len, uargs); | ||
391 | } | ||
392 | |||
393 | asmlinkage long sys32_delete_module(const char __user *name_user, | ||
394 | unsigned int flags) | ||
395 | { | ||
396 | return sys_delete_module(name_user, flags); | ||
397 | } | ||
398 | |||
399 | #else /* CONFIG_MODULES */ | ||
400 | |||
401 | asmlinkage long sys32_init_module(const char __user *name_user, | ||
402 | struct module __user *mod_user) | ||
403 | { | ||
404 | return -ENOSYS; | ||
405 | } | ||
406 | |||
407 | asmlinkage long sys32_delete_module(const char __user *name_user) | ||
408 | { | ||
409 | return -ENOSYS; | ||
410 | } | ||
411 | |||
412 | #endif /* CONFIG_MODULES */ | ||
413 | |||
414 | asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, | 261 | asmlinkage compat_ssize_t sys32_pread64(unsigned int fd, |
415 | char __user *ubuf, | 262 | char __user *ubuf, |
416 | compat_size_t count, | 263 | compat_size_t count, |
@@ -456,16 +303,6 @@ long compat_sys_fadvise64_64(int fd, | |||
456 | advice); | 303 | advice); |
457 | } | 304 | } |
458 | 305 | ||
459 | /* This is just a version for 32-bit applications which does | ||
460 | * not force O_LARGEFILE on. | ||
461 | */ | ||
462 | |||
463 | asmlinkage long sparc32_open(const char __user *filename, | ||
464 | int flags, int mode) | ||
465 | { | ||
466 | return do_sys_open(AT_FDCWD, filename, flags, mode); | ||
467 | } | ||
468 | |||
469 | long sys32_lookup_dcookie(unsigned long cookie_high, | 306 | long sys32_lookup_dcookie(unsigned long cookie_high, |
470 | unsigned long cookie_low, | 307 | unsigned long cookie_low, |
471 | char __user *buf, size_t len) | 308 | char __user *buf, size_t len) |
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index cdd2d7035930..3a8d1844402e 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c | |||
@@ -160,41 +160,12 @@ sparc_breakpoint (struct pt_regs *regs) | |||
160 | #endif | 160 | #endif |
161 | } | 161 | } |
162 | 162 | ||
163 | asmlinkage int | 163 | SYSCALL_DEFINE3(sparc_sigaction, int, sig, |
164 | sparc_sigaction (int sig, const struct old_sigaction __user *act, | 164 | struct old_sigaction __user *,act, |
165 | struct old_sigaction __user *oact) | 165 | struct old_sigaction __user *,oact) |
166 | { | 166 | { |
167 | struct k_sigaction new_ka, old_ka; | ||
168 | int ret; | ||
169 | |||
170 | WARN_ON_ONCE(sig >= 0); | 167 | WARN_ON_ONCE(sig >= 0); |
171 | sig = -sig; | 168 | return sys_sigaction(-sig, act, oact); |
172 | |||
173 | if (act) { | ||
174 | unsigned long mask; | ||
175 | |||
176 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
177 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
178 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
179 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
180 | __get_user(mask, &act->sa_mask)) | ||
181 | return -EFAULT; | ||
182 | siginitset(&new_ka.sa.sa_mask, mask); | ||
183 | new_ka.ka_restorer = NULL; | ||
184 | } | ||
185 | |||
186 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
187 | |||
188 | if (!ret && oact) { | ||
189 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
190 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
191 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
192 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
193 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
194 | return -EFAULT; | ||
195 | } | ||
196 | |||
197 | return ret; | ||
198 | } | 169 | } |
199 | 170 | ||
200 | SYSCALL_DEFINE5(rt_sigaction, int, sig, | 171 | SYSCALL_DEFINE5(rt_sigaction, int, sig, |
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S index e0fed7711a94..22a1098961f5 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S | |||
@@ -25,16 +25,10 @@ sys_nis_syscall: | |||
25 | sys_memory_ordering: | 25 | sys_memory_ordering: |
26 | ba,pt %xcc, sparc_memory_ordering | 26 | ba,pt %xcc, sparc_memory_ordering |
27 | add %sp, PTREGS_OFF, %o1 | 27 | add %sp, PTREGS_OFF, %o1 |
28 | sys_sigaltstack: | ||
29 | ba,pt %xcc, do_sigaltstack | ||
30 | add %i6, STACK_BIAS, %o2 | ||
31 | #ifdef CONFIG_COMPAT | 28 | #ifdef CONFIG_COMPAT |
32 | sys32_sigstack: | 29 | sys32_sigstack: |
33 | ba,pt %xcc, do_sys32_sigstack | 30 | ba,pt %xcc, do_sys32_sigstack |
34 | mov %i6, %o2 | 31 | mov %i6, %o2 |
35 | sys32_sigaltstack: | ||
36 | ba,pt %xcc, do_sys32_sigaltstack | ||
37 | mov %i6, %o2 | ||
38 | #endif | 32 | #endif |
39 | .align 32 | 33 | .align 32 |
40 | #ifdef CONFIG_COMPAT | 34 | #ifdef CONFIG_COMPAT |
diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h index 1dd89dbac8d8..26e6dd72e92a 100644 --- a/arch/sparc/kernel/systbls.h +++ b/arch/sparc/kernel/systbls.h | |||
@@ -36,8 +36,6 @@ extern asmlinkage long sys_rt_sigaction(int sig, | |||
36 | 36 | ||
37 | extern asmlinkage void sparc64_set_context(struct pt_regs *regs); | 37 | extern asmlinkage void sparc64_set_context(struct pt_regs *regs); |
38 | extern asmlinkage void sparc64_get_context(struct pt_regs *regs); | 38 | extern asmlinkage void sparc64_get_context(struct pt_regs *regs); |
39 | extern asmlinkage long sys_sigpause(unsigned int set); | ||
40 | extern asmlinkage long sys_sigsuspend(old_sigset_t set); | ||
41 | extern void do_rt_sigreturn(struct pt_regs *regs); | 39 | extern void do_rt_sigreturn(struct pt_regs *regs); |
42 | 40 | ||
43 | #endif /* _SYSTBLS_H */ | 41 | #endif /* _SYSTBLS_H */ |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 6ac43c36bbbf..7b87171ecf1e 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -55,7 +55,7 @@ sys_call_table: | |||
55 | /*180*/ .long sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_sigpending, sys_ni_syscall | 55 | /*180*/ .long sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_sigpending, sys_ni_syscall |
56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname | 56 | /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname |
57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl | 57 | /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl |
58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask | 58 | /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_sparc_sigaction, sys_sgetmask |
59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir | 59 | /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir |
60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 | 60 | /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 |
61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo | 61 | /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 1009ecb92678..260ddcd412bf 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -18,63 +18,63 @@ | |||
18 | 18 | ||
19 | .globl sys_call_table32 | 19 | .globl sys_call_table32 |
20 | sys_call_table32: | 20 | sys_call_table32: |
21 | /*0*/ .word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write | 21 | /*0*/ .word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write |
22 | /*5*/ .word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link | 22 | /*5*/ .word compat_sys_open, sys_close, compat_sys_wait4, sys_creat, sys_link |
23 | /*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod | 23 | /*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys_mknod |
24 | /*15*/ .word sys_chmod, sys_lchown16, sys_brk, sys_nis_syscall, sys32_lseek | 24 | /*15*/ .word sys_chmod, sys_lchown16, sys_brk, sys_nis_syscall, sys_lseek |
25 | /*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 | 25 | /*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16 |
26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause | 26 | /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, compat_sys_sigaltstack, sys_pause |
27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice | 27 | /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice |
28 | .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile | 28 | .word sys_chown, sys_sync, sys_kill, compat_sys_newstat, sys32_sendfile |
29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid | 29 | /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid |
30 | .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 | 30 | .word sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 |
31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl | 31 | /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl |
32 | .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve | 32 | .word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve |
33 | /*60*/ .word sys32_umask, sys_chroot, compat_sys_newfstat, compat_sys_fstat64, sys_getpagesize | 33 | /*60*/ .word sys_umask, sys_chroot, compat_sys_newfstat, compat_sys_fstat64, sys_getpagesize |
34 | .word sys32_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid | 34 | .word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid |
35 | /*70*/ .word sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect | 35 | /*70*/ .word sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect |
36 | .word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys_getgroups16 | 36 | .word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys_getgroups16 |
37 | /*80*/ .word sys_setgroups16, sys_getpgrp, sys32_setgroups, sys32_setitimer, sys32_ftruncate64 | 37 | /*80*/ .word sys_setgroups16, sys_getpgrp, sys_setgroups, compat_sys_setitimer, sys32_ftruncate64 |
38 | .word sys32_swapon, sys32_getitimer, sys_setuid, sys32_sethostname, sys_setgid | 38 | .word sys_swapon, compat_sys_getitimer, sys_setuid, sys_sethostname, sys_setgid |
39 | /*90*/ .word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid | 39 | /*90*/ .word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid |
40 | .word sys_fsync, sys32_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall | 40 | .word sys_fsync, sys_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall |
41 | /*100*/ .word sys32_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending | 41 | /*100*/ .word sys_getpriority, sys32_rt_sigreturn, compat_sys_rt_sigaction, compat_sys_rt_sigprocmask, compat_sys_rt_sigpending |
42 | .word compat_sys_rt_sigtimedwait, sys32_rt_sigqueueinfo, compat_sys_rt_sigsuspend, sys_setresuid, sys_getresuid | 42 | .word compat_sys_rt_sigtimedwait, compat_sys_rt_sigqueueinfo, compat_sys_rt_sigsuspend, sys_setresuid, sys_getresuid |
43 | /*110*/ .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall | 43 | /*110*/ .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall |
44 | .word sys32_getgroups, compat_sys_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd | 44 | .word sys_getgroups, compat_sys_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd |
45 | /*120*/ .word compat_sys_readv, compat_sys_writev, compat_sys_settimeofday, sys_fchown16, sys_fchmod | 45 | /*120*/ .word compat_sys_readv, compat_sys_writev, compat_sys_settimeofday, sys_fchown16, sys_fchmod |
46 | .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys32_truncate | 46 | .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys_truncate |
47 | /*130*/ .word sys32_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall | 47 | /*130*/ .word sys_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall |
48 | .word sys_nis_syscall, sys32_mkdir, sys_rmdir, compat_sys_utimes, compat_sys_stat64 | 48 | .word sys_nis_syscall, sys_mkdir, sys_rmdir, compat_sys_utimes, compat_sys_stat64 |
49 | /*140*/ .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit | 49 | /*140*/ .word sys_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit |
50 | .word compat_sys_setrlimit, sys_pivot_root, sys32_prctl, sys_pciconfig_read, sys_pciconfig_write | 50 | .word compat_sys_setrlimit, sys_pivot_root, sys_prctl, sys_pciconfig_read, sys_pciconfig_write |
51 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 | 51 | /*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 |
52 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount | 52 | .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount |
53 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall | 53 | /*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall |
54 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, compat_sys_ustat, sys32_setxattr | 54 | .word sys_quotactl, sys_set_tid_address, compat_sys_mount, compat_sys_ustat, sys_setxattr |
55 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents | 55 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents |
56 | .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr | 56 | .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr |
57 | /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall | 57 | /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall |
58 | .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_newuname | 58 | .word sys_setpgid, sys_fremovexattr, sys_tkill, sparc_exit_group, sys_newuname |
59 | /*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl | 59 | /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl |
60 | .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask | 60 | .word sys_epoll_wait, sys_ioprio_set, sys_getppid, compat_sys_sparc_sigaction, sys_sgetmask |
61 | /*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir | 61 | /*200*/ .word sys_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir |
62 | .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64 | 62 | .word sys32_readahead, sys32_socketcall, sys_syslog, sys32_lookup_dcookie, sys32_fadvise64 |
63 | /*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, compat_sys_sysinfo | 63 | /*210*/ .word sys32_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, compat_sys_sysinfo |
64 | .word compat_sys_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex | 64 | .word compat_sys_ipc, sys32_sigreturn, sys_clone, sys_ioprio_get, compat_sys_adjtimex |
65 | /*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid | 65 | /*220*/ .word compat_sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid |
66 | .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 | 66 | .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 |
67 | /*230*/ .word sys32_select, compat_sys_time, sys32_splice, compat_sys_stime, compat_sys_statfs64 | 67 | /*230*/ .word sys32_select, compat_sys_time, sys_splice, compat_sys_stime, compat_sys_statfs64 |
68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall | 68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall |
69 | /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler | 69 | /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler |
70 | .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep | 70 | .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, compat_sys_sched_rr_get_interval, compat_sys_nanosleep |
71 | /*250*/ .word sys_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys_nis_syscall | 71 | /*250*/ .word sys_mremap, compat_sys_sysctl, sys_getsid, sys_fdatasync, sys_nis_syscall |
72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep | 72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep |
73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun | 73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun |
74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy | 74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy |
75 | /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink | 75 | /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink |
76 | .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid | 76 | .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid |
77 | /*280*/ .word sys32_tee, sys_add_key, sys_request_key, compat_sys_keyctl, compat_sys_openat | 77 | /*280*/ .word sys_tee, sys_add_key, sys_request_key, compat_sys_keyctl, compat_sys_openat |
78 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 | 78 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 |
79 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 79 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
80 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare | 80 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare |
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index 48ccf718e290..3e831b3fd07b 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -122,13 +122,3 @@ int do_signal(void) | |||
122 | { | 122 | { |
123 | return kern_do_signal(¤t->thread.regs); | 123 | return kern_do_signal(¤t->thread.regs); |
124 | } | 124 | } |
125 | |||
126 | /* | ||
127 | * Atomically swap in the new signal mask, and wait for a signal. | ||
128 | */ | ||
129 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
130 | { | ||
131 | sigset_t blocked; | ||
132 | siginitset(&blocked, mask); | ||
133 | return sigsuspend(&blocked); | ||
134 | } | ||
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index 60651df5f952..a62786fdcaab 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig | |||
@@ -16,6 +16,7 @@ config UNICORE32 | |||
16 | select ARCH_WANT_FRAME_POINTERS | 16 | select ARCH_WANT_FRAME_POINTERS |
17 | select GENERIC_IOMAP | 17 | select GENERIC_IOMAP |
18 | select MODULES_USE_ELF_REL | 18 | select MODULES_USE_ELF_REL |
19 | select GENERIC_SIGALTSTACK | ||
19 | help | 20 | help |
20 | UniCore-32 is 32-bit Instruction Set Architecture, | 21 | UniCore-32 is 32-bit Instruction Set Architecture, |
21 | including a series of low-power-consumption RISC chip | 22 | including a series of low-power-consumption RISC chip |
diff --git a/arch/unicore32/kernel/entry.S b/arch/unicore32/kernel/entry.S index 581630d91444..bcdedd80890e 100644 --- a/arch/unicore32/kernel/entry.S +++ b/arch/unicore32/kernel/entry.S | |||
@@ -674,11 +674,6 @@ ENTRY(sys_rt_sigreturn) | |||
674 | b __sys_rt_sigreturn | 674 | b __sys_rt_sigreturn |
675 | ENDPROC(sys_rt_sigreturn) | 675 | ENDPROC(sys_rt_sigreturn) |
676 | 676 | ||
677 | ENTRY(sys_sigaltstack) | ||
678 | ldw r2, [sp+], #S_OFF + S_SP | ||
679 | b do_sigaltstack | ||
680 | ENDPROC(sys_sigaltstack) | ||
681 | |||
682 | __INIT | 677 | __INIT |
683 | 678 | ||
684 | /* | 679 | /* |
diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c index b8b2ffd774d6..6905f0ebdc77 100644 --- a/arch/unicore32/kernel/signal.c +++ b/arch/unicore32/kernel/signal.c | |||
@@ -123,8 +123,7 @@ asmlinkage int __sys_rt_sigreturn(struct pt_regs *regs) | |||
123 | if (restore_sigframe(regs, &frame->sig)) | 123 | if (restore_sigframe(regs, &frame->sig)) |
124 | goto badframe; | 124 | goto badframe; |
125 | 125 | ||
126 | if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->UCreg_sp) | 126 | if (restore_altstack(&frame->sig.uc.uc_stack)) |
127 | == -EFAULT) | ||
128 | goto badframe; | 127 | goto badframe; |
129 | 128 | ||
130 | return regs->UCreg_00; | 129 | return regs->UCreg_00; |
@@ -265,7 +264,6 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
265 | { | 264 | { |
266 | struct rt_sigframe __user *frame = | 265 | struct rt_sigframe __user *frame = |
267 | get_sigframe(ka, regs, sizeof(*frame)); | 266 | get_sigframe(ka, regs, sizeof(*frame)); |
268 | stack_t stack; | ||
269 | int err = 0; | 267 | int err = 0; |
270 | 268 | ||
271 | if (!frame) | 269 | if (!frame) |
@@ -275,13 +273,7 @@ static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
275 | 273 | ||
276 | err |= __put_user(0, &frame->sig.uc.uc_flags); | 274 | err |= __put_user(0, &frame->sig.uc.uc_flags); |
277 | err |= __put_user(NULL, &frame->sig.uc.uc_link); | 275 | err |= __put_user(NULL, &frame->sig.uc.uc_link); |
278 | 276 | err |= __save_altstack(&frame->sig.uc.uc_stack, regs->UCreg_sp); | |
279 | memset(&stack, 0, sizeof(stack)); | ||
280 | stack.ss_sp = (void __user *)current->sas_ss_sp; | ||
281 | stack.ss_flags = sas_ss_flags(regs->UCreg_sp); | ||
282 | stack.ss_size = current->sas_ss_size; | ||
283 | err |= __copy_to_user(&frame->sig.uc.uc_stack, &stack, sizeof(stack)); | ||
284 | |||
285 | err |= setup_sigframe(&frame->sig, regs, set); | 277 | err |= setup_sigframe(&frame->sig, regs, set); |
286 | if (err == 0) | 278 | if (err == 0) |
287 | err |= setup_return(regs, ka, frame->sig.retcode, frame, usig); | 279 | err |= setup_return(regs, ka, frame->sig.retcode, frame, usig); |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 79795af59810..87d09175a0a9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -114,6 +114,12 @@ config X86 | |||
114 | select MODULES_USE_ELF_RELA if X86_64 | 114 | select MODULES_USE_ELF_RELA if X86_64 |
115 | select CLONE_BACKWARDS if X86_32 | 115 | select CLONE_BACKWARDS if X86_32 |
116 | select GENERIC_SIGALTSTACK | 116 | select GENERIC_SIGALTSTACK |
117 | select GENERIC_COMPAT_RT_SIGACTION | ||
118 | select GENERIC_COMPAT_RT_SIGQUEUEINFO | ||
119 | select GENERIC_COMPAT_RT_SIGPENDING | ||
120 | select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION | ||
121 | select OLD_SIGACTION if X86_32 | ||
122 | select COMPAT_OLD_SIGACTION if IA32_EMULATION | ||
117 | 123 | ||
118 | config INSTRUCTION_DECODER | 124 | config INSTRUCTION_DECODER |
119 | def_bool y | 125 | def_bool y |
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index a1daf4a65009..b0460cd7de5a 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -129,13 +129,6 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
129 | return err; | 129 | return err; |
130 | } | 130 | } |
131 | 131 | ||
132 | asmlinkage long sys32_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
133 | { | ||
134 | sigset_t blocked; | ||
135 | siginitset(&blocked, mask); | ||
136 | return sigsuspend(&blocked); | ||
137 | } | ||
138 | |||
139 | /* | 132 | /* |
140 | * Do a signal return; undo the signal stack. | 133 | * Do a signal return; undo the signal stack. |
141 | */ | 134 | */ |
@@ -215,8 +208,9 @@ static int ia32_restore_sigcontext(struct pt_regs *regs, | |||
215 | return err; | 208 | return err; |
216 | } | 209 | } |
217 | 210 | ||
218 | asmlinkage long sys32_sigreturn(struct pt_regs *regs) | 211 | asmlinkage long sys32_sigreturn(void) |
219 | { | 212 | { |
213 | struct pt_regs *regs = current_pt_regs(); | ||
220 | struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8); | 214 | struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8); |
221 | sigset_t set; | 215 | sigset_t set; |
222 | unsigned int ax; | 216 | unsigned int ax; |
@@ -241,8 +235,9 @@ badframe: | |||
241 | return 0; | 235 | return 0; |
242 | } | 236 | } |
243 | 237 | ||
244 | asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) | 238 | asmlinkage long sys32_rt_sigreturn(void) |
245 | { | 239 | { |
240 | struct pt_regs *regs = current_pt_regs(); | ||
246 | struct rt_sigframe_ia32 __user *frame; | 241 | struct rt_sigframe_ia32 __user *frame; |
247 | sigset_t set; | 242 | sigset_t set; |
248 | unsigned int ax; | 243 | unsigned int ax; |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 102ff7cb3e41..c05e16b4536b 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -456,18 +456,16 @@ ia32_badsys: | |||
456 | ALIGN | 456 | ALIGN |
457 | GLOBAL(\label) | 457 | GLOBAL(\label) |
458 | leaq \func(%rip),%rax | 458 | leaq \func(%rip),%rax |
459 | leaq -ARGOFFSET+8(%rsp),\arg /* 8 for return address */ | ||
460 | jmp ia32_ptregs_common | 459 | jmp ia32_ptregs_common |
461 | .endm | 460 | .endm |
462 | 461 | ||
463 | CFI_STARTPROC32 | 462 | CFI_STARTPROC32 |
464 | 463 | ||
465 | PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi | 464 | PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn |
466 | PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi | 465 | PTREGSCALL stub32_sigreturn, sys32_sigreturn |
467 | PTREGSCALL stub32_execve, compat_sys_execve, %rcx | 466 | PTREGSCALL stub32_execve, compat_sys_execve |
468 | PTREGSCALL stub32_fork, sys_fork, %rdi | 467 | PTREGSCALL stub32_fork, sys_fork |
469 | PTREGSCALL stub32_vfork, sys_vfork, %rdi | 468 | PTREGSCALL stub32_vfork, sys_vfork |
470 | PTREGSCALL stub32_iopl, sys_iopl, %rsi | ||
471 | 469 | ||
472 | ALIGN | 470 | ALIGN |
473 | GLOBAL(stub32_clone) | 471 | GLOBAL(stub32_clone) |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index d0b689ba7be2..592f5a9a9c0e 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -172,183 +172,12 @@ 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_rt_sigaction(int sig, struct sigaction32 __user *act, | ||
176 | struct sigaction32 __user *oact, | ||
177 | unsigned int sigsetsize) | ||
178 | { | ||
179 | struct k_sigaction new_ka, old_ka; | ||
180 | int ret; | ||
181 | compat_sigset_t set32; | ||
182 | |||
183 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
184 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
185 | return -EINVAL; | ||
186 | |||
187 | if (act) { | ||
188 | compat_uptr_t handler, restorer; | ||
189 | |||
190 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
191 | __get_user(handler, &act->sa_handler) || | ||
192 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
193 | __get_user(restorer, &act->sa_restorer) || | ||
194 | __copy_from_user(&set32, &act->sa_mask, | ||
195 | sizeof(compat_sigset_t))) | ||
196 | return -EFAULT; | ||
197 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
198 | new_ka.sa.sa_restorer = compat_ptr(restorer); | ||
199 | |||
200 | /* | ||
201 | * FIXME: here we rely on _COMPAT_NSIG_WORS to be >= | ||
202 | * than _NSIG_WORDS << 1 | ||
203 | */ | ||
204 | switch (_NSIG_WORDS) { | ||
205 | case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | ||
206 | | (((long)set32.sig[7]) << 32); | ||
207 | case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4] | ||
208 | | (((long)set32.sig[5]) << 32); | ||
209 | case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2] | ||
210 | | (((long)set32.sig[3]) << 32); | ||
211 | case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0] | ||
212 | | (((long)set32.sig[1]) << 32); | ||
213 | } | ||
214 | } | ||
215 | |||
216 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
217 | |||
218 | if (!ret && oact) { | ||
219 | /* | ||
220 | * FIXME: here we rely on _COMPAT_NSIG_WORS to be >= | ||
221 | * than _NSIG_WORDS << 1 | ||
222 | */ | ||
223 | switch (_NSIG_WORDS) { | ||
224 | case 4: | ||
225 | set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32); | ||
226 | set32.sig[6] = old_ka.sa.sa_mask.sig[3]; | ||
227 | case 3: | ||
228 | set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32); | ||
229 | set32.sig[4] = old_ka.sa.sa_mask.sig[2]; | ||
230 | case 2: | ||
231 | set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32); | ||
232 | set32.sig[2] = old_ka.sa.sa_mask.sig[1]; | ||
233 | case 1: | ||
234 | set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32); | ||
235 | set32.sig[0] = old_ka.sa.sa_mask.sig[0]; | ||
236 | } | ||
237 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
238 | __put_user(ptr_to_compat(old_ka.sa.sa_handler), | ||
239 | &oact->sa_handler) || | ||
240 | __put_user(ptr_to_compat(old_ka.sa.sa_restorer), | ||
241 | &oact->sa_restorer) || | ||
242 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
243 | __copy_to_user(&oact->sa_mask, &set32, | ||
244 | sizeof(compat_sigset_t))) | ||
245 | return -EFAULT; | ||
246 | } | ||
247 | |||
248 | return ret; | ||
249 | } | ||
250 | |||
251 | asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act, | ||
252 | struct old_sigaction32 __user *oact) | ||
253 | { | ||
254 | struct k_sigaction new_ka, old_ka; | ||
255 | int ret; | ||
256 | |||
257 | if (act) { | ||
258 | compat_old_sigset_t mask; | ||
259 | compat_uptr_t handler, restorer; | ||
260 | |||
261 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
262 | __get_user(handler, &act->sa_handler) || | ||
263 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
264 | __get_user(restorer, &act->sa_restorer) || | ||
265 | __get_user(mask, &act->sa_mask)) | ||
266 | return -EFAULT; | ||
267 | |||
268 | new_ka.sa.sa_handler = compat_ptr(handler); | ||
269 | new_ka.sa.sa_restorer = compat_ptr(restorer); | ||
270 | |||
271 | siginitset(&new_ka.sa.sa_mask, mask); | ||
272 | } | ||
273 | |||
274 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
275 | |||
276 | if (!ret && oact) { | ||
277 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
278 | __put_user(ptr_to_compat(old_ka.sa.sa_handler), | ||
279 | &oact->sa_handler) || | ||
280 | __put_user(ptr_to_compat(old_ka.sa.sa_restorer), | ||
281 | &oact->sa_restorer) || | ||
282 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
283 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
284 | return -EFAULT; | ||
285 | } | ||
286 | |||
287 | return ret; | ||
288 | } | ||
289 | |||
290 | 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, |
291 | int options) | 176 | int options) |
292 | { | 177 | { |
293 | return compat_sys_wait4(pid, stat_addr, options, NULL); | 178 | return compat_sys_wait4(pid, stat_addr, options, NULL); |
294 | } | 179 | } |
295 | 180 | ||
296 | /* 32-bit timeval and related flotsam. */ | ||
297 | |||
298 | asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid, | ||
299 | struct compat_timespec __user *interval) | ||
300 | { | ||
301 | struct timespec t; | ||
302 | int ret; | ||
303 | mm_segment_t old_fs = get_fs(); | ||
304 | |||
305 | set_fs(KERNEL_DS); | ||
306 | ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t); | ||
307 | set_fs(old_fs); | ||
308 | if (put_compat_timespec(&t, interval)) | ||
309 | return -EFAULT; | ||
310 | return ret; | ||
311 | } | ||
312 | |||
313 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set, | ||
314 | compat_size_t sigsetsize) | ||
315 | { | ||
316 | sigset_t s; | ||
317 | compat_sigset_t s32; | ||
318 | int ret; | ||
319 | mm_segment_t old_fs = get_fs(); | ||
320 | |||
321 | set_fs(KERNEL_DS); | ||
322 | ret = sys_rt_sigpending((sigset_t __user *)&s, sigsetsize); | ||
323 | set_fs(old_fs); | ||
324 | if (!ret) { | ||
325 | switch (_NSIG_WORDS) { | ||
326 | case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3]; | ||
327 | case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2]; | ||
328 | case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1]; | ||
329 | case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0]; | ||
330 | } | ||
331 | if (copy_to_user(set, &s32, sizeof(compat_sigset_t))) | ||
332 | return -EFAULT; | ||
333 | } | ||
334 | return ret; | ||
335 | } | ||
336 | |||
337 | asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig, | ||
338 | compat_siginfo_t __user *uinfo) | ||
339 | { | ||
340 | siginfo_t info; | ||
341 | int ret; | ||
342 | mm_segment_t old_fs = get_fs(); | ||
343 | |||
344 | if (copy_siginfo_from_user32(&info, uinfo)) | ||
345 | return -EFAULT; | ||
346 | set_fs(KERNEL_DS); | ||
347 | ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info); | ||
348 | set_fs(old_fs); | ||
349 | return ret; | ||
350 | } | ||
351 | |||
352 | /* warning: next two assume little endian */ | 181 | /* warning: next two assume little endian */ |
353 | asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, | 182 | asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, |
354 | u32 poslo, u32 poshi) | 183 | u32 poslo, u32 poshi) |
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h index 4c6da2e4bb1d..d0e8e0141041 100644 --- a/arch/x86/include/asm/ia32.h +++ b/arch/x86/include/asm/ia32.h | |||
@@ -13,21 +13,6 @@ | |||
13 | #include <asm/sigcontext32.h> | 13 | #include <asm/sigcontext32.h> |
14 | 14 | ||
15 | /* signal.h */ | 15 | /* signal.h */ |
16 | struct sigaction32 { | ||
17 | unsigned int sa_handler; /* Really a pointer, but need to deal | ||
18 | with 32 bits */ | ||
19 | unsigned int sa_flags; | ||
20 | unsigned int sa_restorer; /* Another 32 bit pointer */ | ||
21 | compat_sigset_t sa_mask; /* A 32 bit mask */ | ||
22 | }; | ||
23 | |||
24 | struct old_sigaction32 { | ||
25 | unsigned int sa_handler; /* Really a pointer, but need to deal | ||
26 | with 32 bits */ | ||
27 | compat_old_sigset_t sa_mask; /* A 32 bit mask */ | ||
28 | unsigned int sa_flags; | ||
29 | unsigned int sa_restorer; /* Another 32 bit pointer */ | ||
30 | }; | ||
31 | 16 | ||
32 | struct ucontext_ia32 { | 17 | struct ucontext_ia32 { |
33 | 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 31f61f96e0fb..0218d917f509 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h | |||
@@ -32,22 +32,11 @@ 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 sigaction32; | ||
36 | struct old_sigaction32; | ||
37 | asmlinkage long sys32_rt_sigaction(int, struct sigaction32 __user *, | ||
38 | struct sigaction32 __user *, unsigned int); | ||
39 | asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *, | ||
40 | struct old_sigaction32 __user *); | ||
41 | asmlinkage long sys32_alarm(unsigned int); | 35 | asmlinkage long sys32_alarm(unsigned int); |
42 | 36 | ||
43 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int); | 37 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int); |
44 | asmlinkage long sys32_sysfs(int, u32, u32); | 38 | asmlinkage long sys32_sysfs(int, u32, u32); |
45 | 39 | ||
46 | asmlinkage long sys32_sched_rr_get_interval(compat_pid_t, | ||
47 | struct compat_timespec __user *); | ||
48 | asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); | ||
49 | asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); | ||
50 | |||
51 | asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); | 40 | asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); |
52 | asmlinkage long sys32_pwrite(unsigned int, const char __user *, u32, u32, u32); | 41 | asmlinkage long sys32_pwrite(unsigned int, const char __user *, u32, u32, u32); |
53 | 42 | ||
@@ -68,9 +57,8 @@ asmlinkage long sys32_fallocate(int, int, unsigned, | |||
68 | unsigned, unsigned, unsigned); | 57 | unsigned, unsigned, unsigned); |
69 | 58 | ||
70 | /* ia32/ia32_signal.c */ | 59 | /* ia32/ia32_signal.c */ |
71 | asmlinkage long sys32_sigsuspend(int, int, old_sigset_t); | 60 | asmlinkage long sys32_sigreturn(void); |
72 | asmlinkage long sys32_sigreturn(struct pt_regs *); | 61 | asmlinkage long sys32_rt_sigreturn(void); |
73 | asmlinkage long sys32_rt_sigreturn(struct pt_regs *); | ||
74 | 62 | ||
75 | /* ia32/ipc32.c */ | 63 | /* ia32/ipc32.c */ |
76 | asmlinkage long sys32_ipc(u32, int, int, int, compat_uptr_t, u32); | 64 | asmlinkage long sys32_ipc(u32, int, int, int, compat_uptr_t, u32); |
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 58b7e3eac0ae..6cf0a9cc60cd 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -18,13 +18,13 @@ | |||
18 | /* Common in X86_32 and X86_64 */ | 18 | /* Common in X86_32 and X86_64 */ |
19 | /* kernel/ioport.c */ | 19 | /* kernel/ioport.c */ |
20 | asmlinkage long sys_ioperm(unsigned long, unsigned long, int); | 20 | asmlinkage long sys_ioperm(unsigned long, unsigned long, int); |
21 | long sys_iopl(unsigned int, struct pt_regs *); | 21 | asmlinkage long sys_iopl(unsigned int); |
22 | 22 | ||
23 | /* kernel/ldt.c */ | 23 | /* kernel/ldt.c */ |
24 | asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); | 24 | asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); |
25 | 25 | ||
26 | /* kernel/signal.c */ | 26 | /* kernel/signal.c */ |
27 | long sys_rt_sigreturn(struct pt_regs *); | 27 | long sys_rt_sigreturn(void); |
28 | 28 | ||
29 | /* kernel/tls.c */ | 29 | /* kernel/tls.c */ |
30 | asmlinkage int sys_set_thread_area(struct user_desc __user *); | 30 | asmlinkage int sys_set_thread_area(struct user_desc __user *); |
@@ -34,14 +34,11 @@ 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_sigsuspend(int, int, old_sigset_t); | 37 | unsigned long sys_sigreturn(void); |
38 | asmlinkage int sys_sigaction(int, const struct old_sigaction __user *, | ||
39 | struct old_sigaction __user *); | ||
40 | unsigned long sys_sigreturn(struct pt_regs *); | ||
41 | 38 | ||
42 | /* kernel/vm86_32.c */ | 39 | /* kernel/vm86_32.c */ |
43 | int sys_vm86old(struct vm86_struct __user *, struct pt_regs *); | 40 | int sys_vm86old(struct vm86_struct __user *); |
44 | int sys_vm86(unsigned long, unsigned long, struct pt_regs *); | 41 | int sys_vm86(unsigned long, unsigned long); |
45 | 42 | ||
46 | #else /* CONFIG_X86_32 */ | 43 | #else /* CONFIG_X86_32 */ |
47 | 44 | ||
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 6ed91d9980e2..352e5a9279ec 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -699,51 +699,6 @@ END(syscall_badsys) | |||
699 | */ | 699 | */ |
700 | .popsection | 700 | .popsection |
701 | 701 | ||
702 | /* | ||
703 | * System calls that need a pt_regs pointer. | ||
704 | */ | ||
705 | #define PTREGSCALL0(name) \ | ||
706 | ENTRY(ptregs_##name) ; \ | ||
707 | leal 4(%esp),%eax; \ | ||
708 | jmp sys_##name; \ | ||
709 | ENDPROC(ptregs_##name) | ||
710 | |||
711 | #define PTREGSCALL1(name) \ | ||
712 | ENTRY(ptregs_##name) ; \ | ||
713 | leal 4(%esp),%edx; \ | ||
714 | movl (PT_EBX+4)(%esp),%eax; \ | ||
715 | jmp sys_##name; \ | ||
716 | ENDPROC(ptregs_##name) | ||
717 | |||
718 | #define PTREGSCALL2(name) \ | ||
719 | ENTRY(ptregs_##name) ; \ | ||
720 | leal 4(%esp),%ecx; \ | ||
721 | movl (PT_ECX+4)(%esp),%edx; \ | ||
722 | movl (PT_EBX+4)(%esp),%eax; \ | ||
723 | jmp sys_##name; \ | ||
724 | ENDPROC(ptregs_##name) | ||
725 | |||
726 | #define PTREGSCALL3(name) \ | ||
727 | ENTRY(ptregs_##name) ; \ | ||
728 | CFI_STARTPROC; \ | ||
729 | leal 4(%esp),%eax; \ | ||
730 | pushl_cfi %eax; \ | ||
731 | movl PT_EDX(%eax),%ecx; \ | ||
732 | movl PT_ECX(%eax),%edx; \ | ||
733 | movl PT_EBX(%eax),%eax; \ | ||
734 | call sys_##name; \ | ||
735 | addl $4,%esp; \ | ||
736 | CFI_ADJUST_CFA_OFFSET -4; \ | ||
737 | ret; \ | ||
738 | CFI_ENDPROC; \ | ||
739 | ENDPROC(ptregs_##name) | ||
740 | |||
741 | PTREGSCALL1(iopl) | ||
742 | PTREGSCALL0(sigreturn) | ||
743 | PTREGSCALL0(rt_sigreturn) | ||
744 | PTREGSCALL2(vm86) | ||
745 | PTREGSCALL1(vm86old) | ||
746 | |||
747 | .macro FIXUP_ESPFIX_STACK | 702 | .macro FIXUP_ESPFIX_STACK |
748 | /* | 703 | /* |
749 | * Switch back for ESPFIX stack to the normal zerobased stack | 704 | * Switch back for ESPFIX stack to the normal zerobased stack |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 07a7a04529bc..197512242e3b 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -828,23 +828,6 @@ int_restore_rest: | |||
828 | CFI_ENDPROC | 828 | CFI_ENDPROC |
829 | END(system_call) | 829 | END(system_call) |
830 | 830 | ||
831 | /* | ||
832 | * Certain special system calls that need to save a complete full stack frame. | ||
833 | */ | ||
834 | .macro PTREGSCALL label,func,arg | ||
835 | ENTRY(\label) | ||
836 | PARTIAL_FRAME 1 8 /* offset 8: return address */ | ||
837 | subq $REST_SKIP, %rsp | ||
838 | CFI_ADJUST_CFA_OFFSET REST_SKIP | ||
839 | call save_rest | ||
840 | DEFAULT_FRAME 0 8 /* offset 8: return address */ | ||
841 | leaq 8(%rsp), \arg /* pt_regs pointer */ | ||
842 | call \func | ||
843 | jmp ptregscall_common | ||
844 | CFI_ENDPROC | ||
845 | END(\label) | ||
846 | .endm | ||
847 | |||
848 | .macro FORK_LIKE func | 831 | .macro FORK_LIKE func |
849 | ENTRY(stub_\func) | 832 | ENTRY(stub_\func) |
850 | CFI_STARTPROC | 833 | CFI_STARTPROC |
@@ -861,10 +844,22 @@ ENTRY(stub_\func) | |||
861 | END(stub_\func) | 844 | END(stub_\func) |
862 | .endm | 845 | .endm |
863 | 846 | ||
847 | .macro FIXED_FRAME label,func | ||
848 | ENTRY(\label) | ||
849 | CFI_STARTPROC | ||
850 | PARTIAL_FRAME 0 8 /* offset 8: return address */ | ||
851 | FIXUP_TOP_OF_STACK %r11, 8-ARGOFFSET | ||
852 | call \func | ||
853 | RESTORE_TOP_OF_STACK %r11, 8-ARGOFFSET | ||
854 | ret | ||
855 | CFI_ENDPROC | ||
856 | END(\label) | ||
857 | .endm | ||
858 | |||
864 | FORK_LIKE clone | 859 | FORK_LIKE clone |
865 | FORK_LIKE fork | 860 | FORK_LIKE fork |
866 | FORK_LIKE vfork | 861 | FORK_LIKE vfork |
867 | PTREGSCALL stub_iopl, sys_iopl, %rsi | 862 | FIXED_FRAME stub_iopl, sys_iopl |
868 | 863 | ||
869 | ENTRY(ptregscall_common) | 864 | ENTRY(ptregscall_common) |
870 | DEFAULT_FRAME 1 8 /* offset 8: return address */ | 865 | DEFAULT_FRAME 1 8 /* offset 8: return address */ |
@@ -886,7 +881,6 @@ ENTRY(stub_execve) | |||
886 | SAVE_REST | 881 | SAVE_REST |
887 | FIXUP_TOP_OF_STACK %r11 | 882 | FIXUP_TOP_OF_STACK %r11 |
888 | call sys_execve | 883 | call sys_execve |
889 | RESTORE_TOP_OF_STACK %r11 | ||
890 | movq %rax,RAX(%rsp) | 884 | movq %rax,RAX(%rsp) |
891 | RESTORE_REST | 885 | RESTORE_REST |
892 | jmp int_ret_from_sys_call | 886 | jmp int_ret_from_sys_call |
@@ -902,7 +896,6 @@ ENTRY(stub_rt_sigreturn) | |||
902 | addq $8, %rsp | 896 | addq $8, %rsp |
903 | PARTIAL_FRAME 0 | 897 | PARTIAL_FRAME 0 |
904 | SAVE_REST | 898 | SAVE_REST |
905 | movq %rsp,%rdi | ||
906 | FIXUP_TOP_OF_STACK %r11 | 899 | FIXUP_TOP_OF_STACK %r11 |
907 | call sys_rt_sigreturn | 900 | call sys_rt_sigreturn |
908 | movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer | 901 | movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer |
@@ -917,7 +910,6 @@ ENTRY(stub_x32_rt_sigreturn) | |||
917 | addq $8, %rsp | 910 | addq $8, %rsp |
918 | PARTIAL_FRAME 0 | 911 | PARTIAL_FRAME 0 |
919 | SAVE_REST | 912 | SAVE_REST |
920 | movq %rsp,%rdi | ||
921 | FIXUP_TOP_OF_STACK %r11 | 913 | FIXUP_TOP_OF_STACK %r11 |
922 | call sys32_x32_rt_sigreturn | 914 | call sys32_x32_rt_sigreturn |
923 | movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer | 915 | movq %rax,RAX(%rsp) # fixme, this could be done at the higher layer |
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 8c968974253d..4ddaf66ea35f 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c | |||
@@ -93,8 +93,9 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) | |||
93 | * on system-call entry - see also fork() and the signal handling | 93 | * on system-call entry - see also fork() and the signal handling |
94 | * code. | 94 | * code. |
95 | */ | 95 | */ |
96 | long sys_iopl(unsigned int level, struct pt_regs *regs) | 96 | SYSCALL_DEFINE1(iopl, unsigned int, level) |
97 | { | 97 | { |
98 | struct pt_regs *regs = current_pt_regs(); | ||
98 | unsigned int old = (regs->flags >> 12) & 3; | 99 | unsigned int old = (regs->flags >> 12) & 3; |
99 | struct thread_struct *t = ¤t->thread; | 100 | struct thread_struct *t = ¤t->thread; |
100 | 101 | ||
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index d6bf1f34a6e9..d5b1f8a912ff 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -535,70 +535,13 @@ 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 | /* | ||
540 | * Atomically swap in the new signal mask, and wait for a signal. | ||
541 | */ | ||
542 | asmlinkage int | ||
543 | sys_sigsuspend(int history0, int history1, old_sigset_t mask) | ||
544 | { | ||
545 | sigset_t blocked; | ||
546 | siginitset(&blocked, mask); | ||
547 | return sigsuspend(&blocked); | ||
548 | } | ||
549 | |||
550 | asmlinkage int | ||
551 | sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
552 | struct old_sigaction __user *oact) | ||
553 | { | ||
554 | struct k_sigaction new_ka, old_ka; | ||
555 | int ret = 0; | ||
556 | |||
557 | if (act) { | ||
558 | old_sigset_t mask; | ||
559 | |||
560 | if (!access_ok(VERIFY_READ, act, sizeof(*act))) | ||
561 | return -EFAULT; | ||
562 | |||
563 | get_user_try { | ||
564 | get_user_ex(new_ka.sa.sa_handler, &act->sa_handler); | ||
565 | get_user_ex(new_ka.sa.sa_flags, &act->sa_flags); | ||
566 | get_user_ex(mask, &act->sa_mask); | ||
567 | get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer); | ||
568 | } get_user_catch(ret); | ||
569 | |||
570 | if (ret) | ||
571 | return -EFAULT; | ||
572 | siginitset(&new_ka.sa.sa_mask, mask); | ||
573 | } | ||
574 | |||
575 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
576 | |||
577 | if (!ret && oact) { | ||
578 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) | ||
579 | return -EFAULT; | ||
580 | |||
581 | put_user_try { | ||
582 | put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler); | ||
583 | put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags); | ||
584 | put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); | ||
585 | put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer); | ||
586 | } put_user_catch(ret); | ||
587 | |||
588 | if (ret) | ||
589 | return -EFAULT; | ||
590 | } | ||
591 | |||
592 | return ret; | ||
593 | } | ||
594 | #endif /* CONFIG_X86_32 */ | ||
595 | |||
596 | /* | 538 | /* |
597 | * Do a signal return; undo the signal stack. | 539 | * Do a signal return; undo the signal stack. |
598 | */ | 540 | */ |
599 | #ifdef CONFIG_X86_32 | 541 | #ifdef CONFIG_X86_32 |
600 | unsigned long sys_sigreturn(struct pt_regs *regs) | 542 | unsigned long sys_sigreturn(void) |
601 | { | 543 | { |
544 | struct pt_regs *regs = current_pt_regs(); | ||
602 | struct sigframe __user *frame; | 545 | struct sigframe __user *frame; |
603 | unsigned long ax; | 546 | unsigned long ax; |
604 | sigset_t set; | 547 | sigset_t set; |
@@ -625,8 +568,9 @@ badframe: | |||
625 | } | 568 | } |
626 | #endif /* CONFIG_X86_32 */ | 569 | #endif /* CONFIG_X86_32 */ |
627 | 570 | ||
628 | long sys_rt_sigreturn(struct pt_regs *regs) | 571 | long sys_rt_sigreturn(void) |
629 | { | 572 | { |
573 | struct pt_regs *regs = current_pt_regs(); | ||
630 | struct rt_sigframe __user *frame; | 574 | struct rt_sigframe __user *frame; |
631 | unsigned long ax; | 575 | unsigned long ax; |
632 | sigset_t set; | 576 | sigset_t set; |
@@ -843,8 +787,9 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where) | |||
843 | } | 787 | } |
844 | 788 | ||
845 | #ifdef CONFIG_X86_X32_ABI | 789 | #ifdef CONFIG_X86_X32_ABI |
846 | asmlinkage long sys32_x32_rt_sigreturn(struct pt_regs *regs) | 790 | asmlinkage long sys32_x32_rt_sigreturn(void) |
847 | { | 791 | { |
792 | struct pt_regs *regs = current_pt_regs(); | ||
848 | struct rt_sigframe_x32 __user *frame; | 793 | struct rt_sigframe_x32 __user *frame; |
849 | sigset_t set; | 794 | sigset_t set; |
850 | unsigned long ax; | 795 | unsigned long ax; |
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index 1dfe69cc78a8..1cf5766dde16 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c | |||
@@ -202,7 +202,7 @@ out: | |||
202 | static int do_vm86_irq_handling(int subfunction, int irqnumber); | 202 | static int do_vm86_irq_handling(int subfunction, int irqnumber); |
203 | static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); | 203 | static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); |
204 | 204 | ||
205 | int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs) | 205 | int sys_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. |
@@ -222,7 +222,7 @@ int sys_vm86old(struct vm86_struct __user *v86, struct pt_regs *regs) | |||
222 | if (tmp) | 222 | if (tmp) |
223 | goto out; | 223 | goto out; |
224 | memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); | 224 | memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); |
225 | info.regs32 = regs; | 225 | info.regs32 = current_pt_regs(); |
226 | tsk->thread.vm86_info = v86; | 226 | tsk->thread.vm86_info = v86; |
227 | do_sys_vm86(&info, tsk); | 227 | do_sys_vm86(&info, tsk); |
228 | ret = 0; /* we never return here */ | 228 | ret = 0; /* we never return here */ |
@@ -231,7 +231,7 @@ out: | |||
231 | } | 231 | } |
232 | 232 | ||
233 | 233 | ||
234 | int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs) | 234 | int sys_vm86(unsigned long cmd, unsigned long arg) |
235 | { | 235 | { |
236 | struct kernel_vm86_struct info; /* declare this _on top_, | 236 | struct kernel_vm86_struct info; /* declare this _on top_, |
237 | * this avoids wasting of stack space. | 237 | * this avoids wasting of stack space. |
@@ -272,7 +272,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg, struct pt_regs *regs) | |||
272 | ret = -EFAULT; | 272 | ret = -EFAULT; |
273 | if (tmp) | 273 | if (tmp) |
274 | goto out; | 274 | goto out; |
275 | info.regs32 = regs; | 275 | info.regs32 = current_pt_regs(); |
276 | info.vm86plus.is_vm86pus = 1; | 276 | info.vm86plus.is_vm86pus = 1; |
277 | tsk->thread.vm86_info = (struct vm86_struct __user *)v86; | 277 | tsk->thread.vm86_info = (struct vm86_struct __user *)v86; |
278 | do_sys_vm86(&info, tsk); | 278 | do_sys_vm86(&info, tsk); |
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index 28e3fa9056ea..f2fe78ff22cc 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl | |||
@@ -73,12 +73,12 @@ | |||
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 |
80 | 71 i386 setregid sys_setregid16 | 80 | 71 i386 setregid sys_setregid16 |
81 | 72 i386 sigsuspend sys_sigsuspend sys32_sigsuspend | 81 | 72 i386 sigsuspend sys_sigsuspend sys_sigsuspend |
82 | 73 i386 sigpending sys_sigpending compat_sys_sigpending | 82 | 73 i386 sigpending sys_sigpending compat_sys_sigpending |
83 | 74 i386 sethostname sys_sethostname | 83 | 74 i386 sethostname sys_sethostname |
84 | 75 i386 setrlimit sys_setrlimit compat_sys_setrlimit | 84 | 75 i386 setrlimit sys_setrlimit compat_sys_setrlimit |
@@ -116,16 +116,16 @@ | |||
116 | 107 i386 lstat sys_newlstat compat_sys_newlstat | 116 | 107 i386 lstat sys_newlstat compat_sys_newlstat |
117 | 108 i386 fstat sys_newfstat compat_sys_newfstat | 117 | 108 i386 fstat sys_newfstat compat_sys_newfstat |
118 | 109 i386 olduname sys_uname | 118 | 109 i386 olduname sys_uname |
119 | 110 i386 iopl ptregs_iopl stub32_iopl | 119 | 110 i386 iopl sys_iopl |
120 | 111 i386 vhangup sys_vhangup | 120 | 111 i386 vhangup sys_vhangup |
121 | 112 i386 idle | 121 | 112 i386 idle |
122 | 113 i386 vm86old ptregs_vm86old sys32_vm86_warning | 122 | 113 i386 vm86old sys_vm86old sys32_vm86_warning |
123 | 114 i386 wait4 sys_wait4 compat_sys_wait4 | 123 | 114 i386 wait4 sys_wait4 compat_sys_wait4 |
124 | 115 i386 swapoff sys_swapoff | 124 | 115 i386 swapoff sys_swapoff |
125 | 116 i386 sysinfo sys_sysinfo compat_sys_sysinfo | 125 | 116 i386 sysinfo sys_sysinfo compat_sys_sysinfo |
126 | 117 i386 ipc sys_ipc sys32_ipc | 126 | 117 i386 ipc sys_ipc sys32_ipc |
127 | 118 i386 fsync sys_fsync | 127 | 118 i386 fsync sys_fsync |
128 | 119 i386 sigreturn ptregs_sigreturn stub32_sigreturn | 128 | 119 i386 sigreturn sys_sigreturn stub32_sigreturn |
129 | 120 i386 clone sys_clone stub32_clone | 129 | 120 i386 clone sys_clone stub32_clone |
130 | 121 i386 setdomainname sys_setdomainname | 130 | 121 i386 setdomainname sys_setdomainname |
131 | 122 i386 uname sys_newuname | 131 | 122 i386 uname sys_newuname |
@@ -167,24 +167,24 @@ | |||
167 | 158 i386 sched_yield sys_sched_yield | 167 | 158 i386 sched_yield sys_sched_yield |
168 | 159 i386 sched_get_priority_max sys_sched_get_priority_max | 168 | 159 i386 sched_get_priority_max sys_sched_get_priority_max |
169 | 160 i386 sched_get_priority_min sys_sched_get_priority_min | 169 | 160 i386 sched_get_priority_min sys_sched_get_priority_min |
170 | 161 i386 sched_rr_get_interval sys_sched_rr_get_interval sys32_sched_rr_get_interval | 170 | 161 i386 sched_rr_get_interval sys_sched_rr_get_interval compat_sys_sched_rr_get_interval |
171 | 162 i386 nanosleep sys_nanosleep compat_sys_nanosleep | 171 | 162 i386 nanosleep sys_nanosleep compat_sys_nanosleep |
172 | 163 i386 mremap sys_mremap | 172 | 163 i386 mremap sys_mremap |
173 | 164 i386 setresuid sys_setresuid16 | 173 | 164 i386 setresuid sys_setresuid16 |
174 | 165 i386 getresuid sys_getresuid16 | 174 | 165 i386 getresuid sys_getresuid16 |
175 | 166 i386 vm86 ptregs_vm86 sys32_vm86_warning | 175 | 166 i386 vm86 sys_vm86 sys32_vm86_warning |
176 | 167 i386 query_module | 176 | 167 i386 query_module |
177 | 168 i386 poll sys_poll | 177 | 168 i386 poll sys_poll |
178 | 169 i386 nfsservctl | 178 | 169 i386 nfsservctl |
179 | 170 i386 setresgid sys_setresgid16 | 179 | 170 i386 setresgid sys_setresgid16 |
180 | 171 i386 getresgid sys_getresgid16 | 180 | 171 i386 getresgid sys_getresgid16 |
181 | 172 i386 prctl sys_prctl | 181 | 172 i386 prctl sys_prctl |
182 | 173 i386 rt_sigreturn ptregs_rt_sigreturn stub32_rt_sigreturn | 182 | 173 i386 rt_sigreturn sys_rt_sigreturn stub32_rt_sigreturn |
183 | 174 i386 rt_sigaction sys_rt_sigaction sys32_rt_sigaction | 183 | 174 i386 rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction |
184 | 175 i386 rt_sigprocmask sys_rt_sigprocmask | 184 | 175 i386 rt_sigprocmask sys_rt_sigprocmask |
185 | 176 i386 rt_sigpending sys_rt_sigpending sys32_rt_sigpending | 185 | 176 i386 rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending |
186 | 177 i386 rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait | 186 | 177 i386 rt_sigtimedwait sys_rt_sigtimedwait compat_sys_rt_sigtimedwait |
187 | 178 i386 rt_sigqueueinfo sys_rt_sigqueueinfo sys32_rt_sigqueueinfo | 187 | 178 i386 rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo |
188 | 179 i386 rt_sigsuspend sys_rt_sigsuspend | 188 | 179 i386 rt_sigsuspend sys_rt_sigsuspend |
189 | 180 i386 pread64 sys_pread64 sys32_pread | 189 | 180 i386 pread64 sys_pread64 sys32_pread |
190 | 181 i386 pwrite64 sys_pwrite64 sys32_pwrite | 190 | 181 i386 pwrite64 sys_pwrite64 sys32_pwrite |
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl index dc97328bd90a..38ae65dfd14f 100644 --- a/arch/x86/syscalls/syscall_64.tbl +++ b/arch/x86/syscalls/syscall_64.tbl | |||
@@ -325,7 +325,7 @@ | |||
325 | # x32-specific system call numbers start at 512 to avoid cache impact | 325 | # x32-specific system call numbers start at 512 to avoid cache impact |
326 | # for native 64-bit operation. | 326 | # for native 64-bit operation. |
327 | # | 327 | # |
328 | 512 x32 rt_sigaction sys32_rt_sigaction | 328 | 512 x32 rt_sigaction compat_sys_rt_sigaction |
329 | 513 x32 rt_sigreturn stub_x32_rt_sigreturn | 329 | 513 x32 rt_sigreturn stub_x32_rt_sigreturn |
330 | 514 x32 ioctl compat_sys_ioctl | 330 | 514 x32 ioctl compat_sys_ioctl |
331 | 515 x32 readv compat_sys_readv | 331 | 515 x32 readv compat_sys_readv |
@@ -335,9 +335,9 @@ | |||
335 | 519 x32 recvmsg compat_sys_recvmsg | 335 | 519 x32 recvmsg compat_sys_recvmsg |
336 | 520 x32 execve stub_x32_execve | 336 | 520 x32 execve stub_x32_execve |
337 | 521 x32 ptrace compat_sys_ptrace | 337 | 521 x32 ptrace compat_sys_ptrace |
338 | 522 x32 rt_sigpending sys32_rt_sigpending | 338 | 522 x32 rt_sigpending compat_sys_rt_sigpending |
339 | 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait | 339 | 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait |
340 | 524 x32 rt_sigqueueinfo sys32_rt_sigqueueinfo | 340 | 524 x32 rt_sigqueueinfo compat_sys_rt_sigqueueinfo |
341 | 525 x32 sigaltstack compat_sys_sigaltstack | 341 | 525 x32 sigaltstack compat_sys_sigaltstack |
342 | 526 x32 timer_create compat_sys_timer_create | 342 | 526 x32 timer_create compat_sys_timer_create |
343 | 527 x32 mq_notify compat_sys_mq_notify | 343 | 527 x32 mq_notify compat_sys_mq_notify |
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 53c90fd412d1..cf0f2731484e 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig | |||
@@ -25,6 +25,8 @@ config X86_32 | |||
25 | select ARCH_WANT_IPC_PARSE_VERSION | 25 | select ARCH_WANT_IPC_PARSE_VERSION |
26 | select MODULES_USE_ELF_REL | 26 | select MODULES_USE_ELF_REL |
27 | select CLONE_BACKWARDS | 27 | select CLONE_BACKWARDS |
28 | select OLD_SIGSUSPEND3 | ||
29 | select OLD_SIGACTION | ||
28 | 30 | ||
29 | config X86_64 | 31 | config X86_64 |
30 | 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/signal.c b/arch/x86/um/signal.c index 71cef48ea5cd..ae7319db18ee 100644 --- a/arch/x86/um/signal.c +++ b/arch/x86/um/signal.c | |||
@@ -464,7 +464,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
464 | return 0; | 464 | return 0; |
465 | } | 465 | } |
466 | 466 | ||
467 | long sys_sigreturn(struct pt_regs *regs) | 467 | long sys_sigreturn(void) |
468 | { | 468 | { |
469 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); | 469 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); |
470 | struct sigframe __user *frame = (struct sigframe __user *)(sp - 8); | 470 | struct sigframe __user *frame = (struct sigframe __user *)(sp - 8); |
@@ -577,7 +577,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
577 | } | 577 | } |
578 | #endif | 578 | #endif |
579 | 579 | ||
580 | long sys_rt_sigreturn(struct pt_regs *regs) | 580 | long sys_rt_sigreturn(void) |
581 | { | 581 | { |
582 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); | 582 | unsigned long sp = PT_REGS_SP(¤t->thread.regs); |
583 | struct rt_sigframe __user *frame = | 583 | struct rt_sigframe __user *frame = |
@@ -601,14 +601,3 @@ long sys_rt_sigreturn(struct pt_regs *regs) | |||
601 | force_sig(SIGSEGV, current); | 601 | force_sig(SIGSEGV, current); |
602 | return 0; | 602 | return 0; |
603 | } | 603 | } |
604 | |||
605 | #ifdef CONFIG_X86_32 | ||
606 | long ptregs_sigreturn(void) | ||
607 | { | ||
608 | return sys_sigreturn(NULL); | ||
609 | } | ||
610 | long ptregs_rt_sigreturn(void) | ||
611 | { | ||
612 | return sys_rt_sigreturn(NULL); | ||
613 | } | ||
614 | #endif | ||
diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c index a0c3b0d1a122..531d4269e2e3 100644 --- a/arch/x86/um/sys_call_table_32.c +++ b/arch/x86/um/sys_call_table_32.c | |||
@@ -24,10 +24,6 @@ | |||
24 | 24 | ||
25 | #define old_mmap sys_old_mmap | 25 | #define old_mmap sys_old_mmap |
26 | 26 | ||
27 | #define ptregs_iopl sys_iopl | ||
28 | #define ptregs_vm86old sys_vm86old | ||
29 | #define ptregs_vm86 sys_vm86 | ||
30 | |||
31 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; | 27 | #define __SYSCALL_I386(nr, sym, compat) extern asmlinkage void sym(void) ; |
32 | #include <asm/syscalls_32.h> | 28 | #include <asm/syscalls_32.h> |
33 | 29 | ||
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 | } | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 5aab1acabf1c..23cc6ae35da0 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -16,6 +16,7 @@ config XTENSA | |||
16 | select ARCH_WANT_OPTIONAL_GPIOLIB | 16 | select ARCH_WANT_OPTIONAL_GPIOLIB |
17 | select CLONE_BACKWARDS | 17 | select CLONE_BACKWARDS |
18 | select IRQ_DOMAIN | 18 | select IRQ_DOMAIN |
19 | select GENERIC_SIGALTSTACK | ||
19 | help | 20 | help |
20 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 21 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
21 | primarily for embedded systems. These processors are both | 22 | primarily for embedded systems. These processors are both |
diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h index 08a23ddac295..3673ff1f1bc5 100644 --- a/arch/xtensa/include/asm/syscall.h +++ b/arch/xtensa/include/asm/syscall.h | |||
@@ -12,7 +12,6 @@ struct pt_regs; | |||
12 | asmlinkage long xtensa_ptrace(long, long, long, long); | 12 | asmlinkage long xtensa_ptrace(long, long, long, long); |
13 | asmlinkage long xtensa_sigreturn(struct pt_regs*); | 13 | asmlinkage long xtensa_sigreturn(struct pt_regs*); |
14 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); | 14 | asmlinkage long xtensa_rt_sigreturn(struct pt_regs*); |
15 | asmlinkage long xtensa_sigaltstack(struct pt_regs *regs); | ||
16 | asmlinkage long xtensa_shmat(int, char __user *, int); | 15 | asmlinkage long xtensa_shmat(int, char __user *, int); |
17 | asmlinkage long xtensa_fadvise64_64(int, int, | 16 | asmlinkage long xtensa_fadvise64_64(int, int, |
18 | unsigned long long, unsigned long long); | 17 | unsigned long long, unsigned long long); |
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index 5162418c5d90..19fac3f543a2 100644 --- a/arch/xtensa/include/uapi/asm/unistd.h +++ b/arch/xtensa/include/uapi/asm/unistd.h | |||
@@ -483,7 +483,7 @@ __SYSCALL(222, sys_ni_syscall, 0) | |||
483 | #define __NR_restart_syscall 223 | 483 | #define __NR_restart_syscall 223 |
484 | __SYSCALL(223, sys_restart_syscall, 0) | 484 | __SYSCALL(223, sys_restart_syscall, 0) |
485 | #define __NR_sigaltstack 224 | 485 | #define __NR_sigaltstack 224 |
486 | __SYSCALL(224, xtensa_sigaltstack, 2) | 486 | __SYSCALL(224, sys_sigaltstack, 2) |
487 | #define __NR_rt_sigreturn 225 | 487 | #define __NR_rt_sigreturn 225 |
488 | __SYSCALL(225, xtensa_rt_sigreturn, 1) | 488 | __SYSCALL(225, xtensa_rt_sigreturn, 1) |
489 | #define __NR_rt_sigaction 226 | 489 | #define __NR_rt_sigaction 226 |
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index de34d6be91cd..d7590dddd084 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c | |||
@@ -265,7 +265,7 @@ asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3, | |||
265 | 265 | ||
266 | ret = regs->areg[2]; | 266 | ret = regs->areg[2]; |
267 | 267 | ||
268 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->areg[1]) == -EFAULT) | 268 | if (restore_altstack(&frame->uc.uc_stack)) |
269 | goto badframe; | 269 | goto badframe; |
270 | 270 | ||
271 | return ret; | 271 | return ret; |
@@ -368,11 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
368 | 368 | ||
369 | err |= __put_user(0, &frame->uc.uc_flags); | 369 | err |= __put_user(0, &frame->uc.uc_flags); |
370 | err |= __put_user(0, &frame->uc.uc_link); | 370 | err |= __put_user(0, &frame->uc.uc_link); |
371 | err |= __put_user((void *)current->sas_ss_sp, | 371 | err |= __save_altstack(&frame->uc.uc_stack, regs->areg[1]); |
372 | &frame->uc.uc_stack.ss_sp); | ||
373 | err |= __put_user(sas_ss_flags(regs->areg[1]), | ||
374 | &frame->uc.uc_stack.ss_flags); | ||
375 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | ||
376 | err |= setup_sigcontext(frame, regs); | 372 | err |= setup_sigcontext(frame, regs); |
377 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 373 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
378 | 374 | ||
@@ -424,16 +420,6 @@ give_sigsegv: | |||
424 | return -EFAULT; | 420 | return -EFAULT; |
425 | } | 421 | } |
426 | 422 | ||
427 | asmlinkage long xtensa_sigaltstack(const stack_t __user *uss, | ||
428 | stack_t __user *uoss, | ||
429 | long a2, long a3, long a4, long a5, | ||
430 | struct pt_regs *regs) | ||
431 | { | ||
432 | return do_sigaltstack(uss, uoss, regs->areg[1]); | ||
433 | } | ||
434 | |||
435 | |||
436 | |||
437 | /* | 423 | /* |
438 | * Note that 'init' is a special process: it doesn't get signals it doesn't | 424 | * Note that 'init' is a special process: it doesn't get signals it doesn't |
439 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 425 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
diff --git a/kernel/signal.c b/kernel/signal.c index 775f5552fa0e..87c09e3061d2 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -3562,7 +3562,6 @@ int sigsuspend(sigset_t *set) | |||
3562 | return -ERESTARTNOHAND; | 3562 | return -ERESTARTNOHAND; |
3563 | } | 3563 | } |
3564 | 3564 | ||
3565 | #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
3566 | /** | 3565 | /** |
3567 | * sys_rt_sigsuspend - replace the signal mask for a value with the | 3566 | * sys_rt_sigsuspend - replace the signal mask for a value with the |
3568 | * @unewset value until a signal is received | 3567 | * @unewset value until a signal is received |
@@ -3603,7 +3602,6 @@ COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_ | |||
3603 | #endif | 3602 | #endif |
3604 | } | 3603 | } |
3605 | #endif | 3604 | #endif |
3606 | #endif | ||
3607 | 3605 | ||
3608 | #ifdef CONFIG_OLD_SIGSUSPEND | 3606 | #ifdef CONFIG_OLD_SIGSUSPEND |
3609 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) | 3607 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) |