aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 21:50:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 21:50:11 -0500
commit9e2d59ad580d590134285f361a0e80f0e98c0207 (patch)
treef3232be75781484193413f32ec82c21f6d8eb76e /arch/m68k
parent5ce1a70e2f00f0bce0cab57f798ca354b9496169 (diff)
parent235b80226b986dabcbba844968f7807866bd0bfe (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull signal handling cleanups from Al Viro: "This is the first pile; another one will come a bit later and will contain SYSCALL_DEFINE-related patches. - a bunch of signal-related syscalls (both native and compat) unified. - a bunch of compat syscalls switched to COMPAT_SYSCALL_DEFINE (fixing several potential problems with missing argument validation, while we are at it) - a lot of now-pointless wrappers killed - a couple of architectures (cris and hexagon) forgot to save altstack settings into sigframe, even though they used the (uninitialized) values in sigreturn; fixed. - microblaze fixes for delivery of multiple signals arriving at once - saner set of helpers for signal delivery introduced, several architectures switched to using those." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (143 commits) x86: convert to ksignal sparc: convert to ksignal arm: switch to struct ksignal * passing alpha: pass k_sigaction and siginfo_t using ksignal pointer burying unused conditionals make do_sigaltstack() static arm64: switch to generic old sigaction() (compat-only) arm64: switch to generic compat rt_sigaction() arm64: switch compat to generic old sigsuspend arm64: switch to generic compat rt_sigqueueinfo() arm64: switch to generic compat rt_sigpending() arm64: switch to generic compat rt_sigprocmask() arm64: switch to generic sigaltstack sparc: switch to generic old sigsuspend sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINE sparc: kill sign-extending wrappers for native syscalls kill sparc32_open() sparc: switch to use of generic old sigaction sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINE mips: switch to generic sys_fork() and sys_clone() ...
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/Kconfig2
-rw-r--r--arch/m68k/include/asm/signal.h19
-rw-r--r--arch/m68k/include/asm/unistd.h2
-rw-r--r--arch/m68k/kernel/signal.c59
4 files changed, 7 insertions, 75 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 6710084e072a..efb1ce1f14a3 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -18,6 +18,8 @@ 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 OLD_SIGSUSPEND3
22 select OLD_SIGACTION
21 23
22config RWSEM_GENERIC_SPINLOCK 24config RWSEM_GENERIC_SPINLOCK
23 bool 25 bool
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h
index 9c8c46b06b0c..214320b50384 100644
--- a/arch/m68k/include/asm/signal.h
+++ b/arch/m68k/include/asm/signal.h
@@ -16,23 +16,8 @@ typedef struct {
16 unsigned long sig[_NSIG_WORDS]; 16 unsigned long sig[_NSIG_WORDS];
17} sigset_t; 17} sigset_t;
18 18
19struct old_sigaction { 19#define __ARCH_HAS_SA_RESTORER
20 __sighandler_t sa_handler; 20
21 old_sigset_t sa_mask;
22 unsigned long sa_flags;
23 __sigrestore_t sa_restorer;
24};
25
26struct sigaction {
27 __sighandler_t sa_handler;
28 unsigned long sa_flags;
29 __sigrestore_t sa_restorer;
30 sigset_t sa_mask; /* mask last for extensibility */
31};
32
33struct k_sigaction {
34 struct sigaction sa;
35};
36#include <asm/sigcontext.h> 21#include <asm/sigcontext.h>
37 22
38#ifndef CONFIG_CPU_HAS_NO_BITFIELDS 23#ifndef CONFIG_CPU_HAS_NO_BITFIELDS
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index f9337f614660..6cd92671ca5e 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -29,8 +29,6 @@
29#define __ARCH_WANT_SYS_OLDUMOUNT 29#define __ARCH_WANT_SYS_OLDUMOUNT
30#define __ARCH_WANT_SYS_SIGPENDING 30#define __ARCH_WANT_SYS_SIGPENDING
31#define __ARCH_WANT_SYS_SIGPROCMASK 31#define __ARCH_WANT_SYS_SIGPROCMASK
32#define __ARCH_WANT_SYS_RT_SIGACTION
33#define __ARCH_WANT_SYS_RT_SIGSUSPEND
34#define __ARCH_WANT_SYS_FORK 32#define __ARCH_WANT_SYS_FORK
35#define __ARCH_WANT_SYS_VFORK 33#define __ARCH_WANT_SYS_VFORK
36 34
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 */
230asmlinkage int
231sys_sigsuspend(int unused0, int unused1, old_sigset_t mask)
232{
233 sigset_t blocked;
234 siginitset(&blocked, mask);
235 return sigsuspend(&blocked);
236}
237
238asmlinkage int
239sys_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
270asmlinkage int
271sys_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