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/avr32/kernel/signal.c | |
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/avr32/kernel/signal.c')
-rw-r--r-- | arch/avr32/kernel/signal.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c index 64f886fac2ef..ae386c304bee 100644 --- a/arch/avr32/kernel/signal.c +++ b/arch/avr32/kernel/signal.c | |||
@@ -77,6 +77,9 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
77 | struct rt_sigframe __user *frame; | 77 | struct rt_sigframe __user *frame; |
78 | sigset_t set; | 78 | sigset_t set; |
79 | 79 | ||
80 | /* Always make any pending restarted system calls return -EINTR */ | ||
81 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
82 | |||
80 | frame = (struct rt_sigframe __user *)regs->sp; | 83 | frame = (struct rt_sigframe __user *)regs->sp; |
81 | pr_debug("SIG return: frame = %p\n", frame); | 84 | pr_debug("SIG return: frame = %p\n", frame); |
82 | 85 | ||
@@ -87,10 +90,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) | |||
87 | goto badframe; | 90 | goto badframe; |
88 | 91 | ||
89 | sigdelsetmask(&set, ~_BLOCKABLE); | 92 | sigdelsetmask(&set, ~_BLOCKABLE); |
90 | spin_lock_irq(¤t->sighand->siglock); | 93 | set_current_blocked(&set); |
91 | current->blocked = set; | ||
92 | recalc_sigpending(); | ||
93 | spin_unlock_irq(¤t->sighand->siglock); | ||
94 | 94 | ||
95 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 95 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
96 | goto badframe; | 96 | goto badframe; |
@@ -238,22 +238,16 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
238 | */ | 238 | */ |
239 | ret |= !valid_user_regs(regs); | 239 | ret |= !valid_user_regs(regs); |
240 | 240 | ||
241 | /* | 241 | if (ret != 0) { |
242 | * Block the signal if we were unsuccessful. | 242 | force_sigsegv(sig, current); |
243 | */ | ||
244 | if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) { | ||
245 | spin_lock_irq(¤t->sighand->siglock); | ||
246 | sigorsets(¤t->blocked, ¤t->blocked, | ||
247 | &ka->sa.sa_mask); | ||
248 | sigaddset(¤t->blocked, sig); | ||
249 | recalc_sigpending(); | ||
250 | spin_unlock_irq(¤t->sighand->siglock); | ||
251 | } | ||
252 | |||
253 | if (ret == 0) | ||
254 | return; | 243 | return; |
244 | } | ||
255 | 245 | ||
256 | force_sigsegv(sig, current); | 246 | /* |
247 | * Block the signal if we were successful. | ||
248 | */ | ||
249 | block_sigmask(ka, sig); | ||
250 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
257 | } | 251 | } |
258 | 252 | ||
259 | /* | 253 | /* |