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/cris/arch-v32 | |
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/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 68 |
1 files changed, 6 insertions, 62 deletions
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; |