diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-23 21:11:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-23 21:11:45 -0400 |
commit | f9369910a6225b8d4892c3f20ae740a711cd5ace (patch) | |
tree | 8650ff79d7607bceb35509c028400ecf1c317de0 /arch/mips/kernel | |
parent | 05f144a0d5c2207a0349348127f996e104ad7404 (diff) | |
parent | 415d04d08fec74b226c92c1fb54ad117c9c6bac4 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull first series of signal handling cleanups from Al Viro:
"This is just the first part of the queue (about a half of it);
assorted fixes all over the place in signal handling.
This one ends with all sigsuspend() implementations switched to
generic one (->saved_sigmask-based).
With this, a bunch of assorted old buglets are fixed and most of the
missing bits of NOTIFY_RESUME hookup are in place. Two more fixes sit
in arm and um trees respectively, and there's a couple of broken ones
that need obvious fixes - parisc and avr32 check TIF_NOTIFY_RESUME
only on one of two codepaths; fixes for that will happen in the next
series"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (55 commits)
unicore32: if there's no handler we need to restore sigmask, syscall or no syscall
xtensa: add handling of TIF_NOTIFY_RESUME
microblaze: drop 'oldset' argument of do_notify_resume()
microblaze: handle TIF_NOTIFY_RESUME
score: add handling of NOTIFY_RESUME to do_notify_resume()
m68k: add TIF_NOTIFY_RESUME and handle it.
sparc: kill ancient comment in sparc_sigaction()
h8300: missing checks of __get_user()/__put_user() return values
frv: missing checks of __get_user()/__put_user() return values
cris: missing checks of __get_user()/__put_user() return values
powerpc: missing checks of __get_user()/__put_user() return values
sh: missing checks of __get_user()/__put_user() return values
sparc: missing checks of __get_user()/__put_user() return values
avr32: struct old_sigaction is never used
m32r: struct old_sigaction is never used
xtensa: xtensa_sigaction doesn't exist
alpha: tidy signal delivery up
score: don't open-code force_sigsegv()
cris: don't open-code force_sigsegv()
blackfin: don't open-code force_sigsegv()
...
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/signal.c | 20 | ||||
-rw-r--r-- | arch/mips/kernel/signal32.c | 20 | ||||
-rw-r--r-- | arch/mips/kernel/signal_n32.c | 10 |
3 files changed, 5 insertions, 45 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index d5a338a1739c..17f6ee30ad0d 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -255,15 +255,7 @@ asmlinkage int sys_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
255 | uset = (sigset_t __user *) regs.regs[4]; | 255 | uset = (sigset_t __user *) regs.regs[4]; |
256 | if (copy_from_user(&newset, uset, sizeof(sigset_t))) | 256 | if (copy_from_user(&newset, uset, sizeof(sigset_t))) |
257 | return -EFAULT; | 257 | return -EFAULT; |
258 | sigdelsetmask(&newset, ~_BLOCKABLE); | 258 | return sigsuspend(&newset); |
259 | |||
260 | current->saved_sigmask = current->blocked; | ||
261 | set_current_blocked(&newset); | ||
262 | |||
263 | current->state = TASK_INTERRUPTIBLE; | ||
264 | schedule(); | ||
265 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
266 | return -ERESTARTNOHAND; | ||
267 | } | 259 | } |
268 | #endif | 260 | #endif |
269 | 261 | ||
@@ -281,15 +273,7 @@ asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
281 | unewset = (sigset_t __user *) regs.regs[4]; | 273 | unewset = (sigset_t __user *) regs.regs[4]; |
282 | if (copy_from_user(&newset, unewset, sizeof(newset))) | 274 | if (copy_from_user(&newset, unewset, sizeof(newset))) |
283 | return -EFAULT; | 275 | return -EFAULT; |
284 | sigdelsetmask(&newset, ~_BLOCKABLE); | 276 | return sigsuspend(&newset); |
285 | |||
286 | current->saved_sigmask = current->blocked; | ||
287 | set_current_blocked(&newset); | ||
288 | |||
289 | current->state = TASK_INTERRUPTIBLE; | ||
290 | schedule(); | ||
291 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
292 | return -ERESTARTNOHAND; | ||
293 | } | 277 | } |
294 | 278 | ||
295 | #ifdef CONFIG_TRAD_SIGNALS | 279 | #ifdef CONFIG_TRAD_SIGNALS |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index ac3b8d89aae5..b4fe2eacbd5d 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -288,15 +288,7 @@ asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
288 | uset = (compat_sigset_t __user *) regs.regs[4]; | 288 | uset = (compat_sigset_t __user *) regs.regs[4]; |
289 | if (get_sigset(&newset, uset)) | 289 | if (get_sigset(&newset, uset)) |
290 | return -EFAULT; | 290 | return -EFAULT; |
291 | sigdelsetmask(&newset, ~_BLOCKABLE); | 291 | return sigsuspend(&newset); |
292 | |||
293 | current->saved_sigmask = current->blocked; | ||
294 | set_current_blocked(&newset); | ||
295 | |||
296 | current->state = TASK_INTERRUPTIBLE; | ||
297 | schedule(); | ||
298 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
299 | return -ERESTARTNOHAND; | ||
300 | } | 292 | } |
301 | 293 | ||
302 | asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | 294 | asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) |
@@ -313,15 +305,7 @@ asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
313 | uset = (compat_sigset_t __user *) regs.regs[4]; | 305 | uset = (compat_sigset_t __user *) regs.regs[4]; |
314 | if (get_sigset(&newset, uset)) | 306 | if (get_sigset(&newset, uset)) |
315 | return -EFAULT; | 307 | return -EFAULT; |
316 | sigdelsetmask(&newset, ~_BLOCKABLE); | 308 | return sigsuspend(&newset); |
317 | |||
318 | current->saved_sigmask = current->blocked; | ||
319 | set_current_blocked(&newset); | ||
320 | |||
321 | current->state = TASK_INTERRUPTIBLE; | ||
322 | schedule(); | ||
323 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
324 | return -ERESTARTNOHAND; | ||
325 | } | 309 | } |
326 | 310 | ||
327 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, | 311 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 86eb4b04631c..63ffac9af7c5 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -91,15 +91,7 @@ asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
91 | if (copy_from_user(&uset, unewset, sizeof(uset))) | 91 | if (copy_from_user(&uset, unewset, sizeof(uset))) |
92 | return -EFAULT; | 92 | return -EFAULT; |
93 | sigset_from_compat(&newset, &uset); | 93 | sigset_from_compat(&newset, &uset); |
94 | sigdelsetmask(&newset, ~_BLOCKABLE); | 94 | return sigsuspend(&newset); |
95 | |||
96 | current->saved_sigmask = current->blocked; | ||
97 | set_current_blocked(&newset); | ||
98 | |||
99 | current->state = TASK_INTERRUPTIBLE; | ||
100 | schedule(); | ||
101 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
102 | return -ERESTARTNOHAND; | ||
103 | } | 95 | } |
104 | 96 | ||
105 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 97 | asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |