x86: signal: handle_signal() should use set_current_blocked()
This is ugly, but if sigprocmask() needs retarget_shared_pending() then handle signal should follow this logic. In theory it is newer correct to add the new signals to current->blocked, the signal handler can sleep/etc so we should notify other threads in case we block the pending signal and nobody else has TIF_SIGPENDING. Of course, this change doesn't make signals faster :/ Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com> Acked-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
e6fa16ab9c
commit
e6a585801b
1 changed files with 4 additions and 5 deletions
|
@ -682,6 +682,7 @@ static int
|
||||||
handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
|
handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
|
||||||
sigset_t *oldset, struct pt_regs *regs)
|
sigset_t *oldset, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
sigset_t blocked;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Are we from a system call? */
|
/* Are we from a system call? */
|
||||||
|
@ -741,12 +742,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
|
||||||
*/
|
*/
|
||||||
regs->flags &= ~X86_EFLAGS_TF;
|
regs->flags &= ~X86_EFLAGS_TF;
|
||||||
|
|
||||||
spin_lock_irq(¤t->sighand->siglock);
|
sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask);
|
||||||
sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
|
|
||||||
if (!(ka->sa.sa_flags & SA_NODEFER))
|
if (!(ka->sa.sa_flags & SA_NODEFER))
|
||||||
sigaddset(¤t->blocked, sig);
|
sigaddset(&blocked, sig);
|
||||||
recalc_sigpending();
|
set_current_blocked(&blocked);
|
||||||
spin_unlock_irq(¤t->sighand->siglock);
|
|
||||||
|
|
||||||
tracehook_signal_handler(sig, info, ka, regs,
|
tracehook_signal_handler(sig, info, ka, regs,
|
||||||
test_thread_flag(TIF_SINGLESTEP));
|
test_thread_flag(TIF_SINGLESTEP));
|
||||||
|
|
Loading…
Reference in a new issue