diff options
author | Matt Fleming <matt.fleming@intel.com> | 2011-08-11 09:57:06 -0400 |
---|---|---|
committer | Guan Xuetao <gxt@mprc.pku.edu.cn> | 2012-01-09 21:29:41 -0500 |
commit | 7037bd803e24d4fdaa87f27456e686aafb061277 (patch) | |
tree | 4ca8c8d236244b2446a9aa8c58c7bafcbb5a0389 /arch/unicore32 | |
parent | a50e4213e71adc7dde0d514aabd8af7275fee39f (diff) |
unicore32: Use set_current_blocked()
As described in e6fa16ab ("signal: sigprocmask() should do
retarget_shared_pending()") the modification of current->blocked is
incorrect as we need to check whether the signal we're about to block
is pending in the shared queue.
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Diffstat (limited to 'arch/unicore32')
-rw-r--r-- | arch/unicore32/kernel/signal.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c index b163fca56789..911b549a6df5 100644 --- a/arch/unicore32/kernel/signal.c +++ b/arch/unicore32/kernel/signal.c | |||
@@ -63,10 +63,7 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf) | |||
63 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); | 63 | err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set)); |
64 | if (err == 0) { | 64 | if (err == 0) { |
65 | sigdelsetmask(&set, ~_BLOCKABLE); | 65 | sigdelsetmask(&set, ~_BLOCKABLE); |
66 | spin_lock_irq(¤t->sighand->siglock); | 66 | set_current_blocked(&set); |
67 | current->blocked = set; | ||
68 | recalc_sigpending(); | ||
69 | spin_unlock_irq(¤t->sighand->siglock); | ||
70 | } | 67 | } |
71 | 68 | ||
72 | err |= __get_user(regs->UCreg_00, &sf->uc.uc_mcontext.regs.UCreg_00); | 69 | err |= __get_user(regs->UCreg_00, &sf->uc.uc_mcontext.regs.UCreg_00); |
@@ -321,6 +318,7 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
321 | { | 318 | { |
322 | struct thread_info *thread = current_thread_info(); | 319 | struct thread_info *thread = current_thread_info(); |
323 | struct task_struct *tsk = current; | 320 | struct task_struct *tsk = current; |
321 | sigset_t blocked; | ||
324 | int usig = sig; | 322 | int usig = sig; |
325 | int ret; | 323 | int ret; |
326 | 324 | ||
@@ -372,13 +370,10 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
372 | /* | 370 | /* |
373 | * Block the signal if we were successful. | 371 | * Block the signal if we were successful. |
374 | */ | 372 | */ |
375 | spin_lock_irq(&tsk->sighand->siglock); | 373 | sigorsets(&blocked, &tsk->blocked, &ka->sa.sa_mask); |
376 | sigorsets(&tsk->blocked, &tsk->blocked, | ||
377 | &ka->sa.sa_mask); | ||
378 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 374 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
379 | sigaddset(&tsk->blocked, sig); | 375 | sigaddset(&blocked, sig); |
380 | recalc_sigpending(); | 376 | set_current_blocked(&blocked); |
381 | spin_unlock_irq(&tsk->sighand->siglock); | ||
382 | 377 | ||
383 | return 0; | 378 | return 0; |
384 | } | 379 | } |