diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 21:50:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 21:50:11 -0500 |
commit | 9e2d59ad580d590134285f361a0e80f0e98c0207 (patch) | |
tree | f3232be75781484193413f32ec82c21f6d8eb76e /arch/mn10300 | |
parent | 5ce1a70e2f00f0bce0cab57f798ca354b9496169 (diff) | |
parent | 235b80226b986dabcbba844968f7807866bd0bfe (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/mn10300')
-rw-r--r-- | arch/mn10300/Kconfig | 2 | ||||
-rw-r--r-- | arch/mn10300/include/asm/signal.h | 19 | ||||
-rw-r--r-- | arch/mn10300/include/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/mn10300/kernel/signal.c | 60 |
4 files changed, 6 insertions, 77 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index e70001cfa05b..ad0caea0bfea 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -10,6 +10,8 @@ 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 OLD_SIGSUSPEND3 | ||
14 | select OLD_SIGACTION | ||
13 | 15 | ||
14 | config AM33_2 | 16 | config AM33_2 |
15 | def_bool n | 17 | def_bool n |
diff --git a/arch/mn10300/include/asm/signal.h b/arch/mn10300/include/asm/signal.h index d280e9780793..214ff5e9fe60 100644 --- a/arch/mn10300/include/asm/signal.h +++ b/arch/mn10300/include/asm/signal.h | |||
@@ -26,23 +26,8 @@ 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 { | 29 | #define __ARCH_HAS_SA_RESTORER |
30 | __sighandler_t sa_handler; | 30 | |
31 | old_sigset_t sa_mask; | ||
32 | unsigned long sa_flags; | ||
33 | __sigrestore_t sa_restorer; | ||
34 | }; | ||
35 | |||
36 | struct sigaction { | ||
37 | __sighandler_t sa_handler; | ||
38 | unsigned long sa_flags; | ||
39 | __sigrestore_t sa_restorer; | ||
40 | sigset_t sa_mask; /* mask last for extensibility */ | ||
41 | }; | ||
42 | |||
43 | struct k_sigaction { | ||
44 | struct sigaction sa; | ||
45 | }; | ||
46 | #include <asm/sigcontext.h> | 31 | #include <asm/sigcontext.h> |
47 | 32 | ||
48 | #endif /* _ASM_SIGNAL_H */ | 33 | #endif /* _ASM_SIGNAL_H */ |
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index e6d2ed4ba68f..7f9d9adfa51e 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h | |||
@@ -41,8 +41,6 @@ | |||
41 | #define __ARCH_WANT_SYS_OLDUMOUNT | 41 | #define __ARCH_WANT_SYS_OLDUMOUNT |
42 | #define __ARCH_WANT_SYS_SIGPENDING | 42 | #define __ARCH_WANT_SYS_SIGPENDING |
43 | #define __ARCH_WANT_SYS_SIGPROCMASK | 43 | #define __ARCH_WANT_SYS_SIGPROCMASK |
44 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
45 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
46 | #define __ARCH_WANT_SYS_FORK | 44 | #define __ARCH_WANT_SYS_FORK |
47 | #define __ARCH_WANT_SYS_VFORK | 45 | #define __ARCH_WANT_SYS_VFORK |
48 | #define __ARCH_WANT_SYS_CLONE | 46 | #define __ARCH_WANT_SYS_CLONE |
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))) |