Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: no need to reset handler if SA_ONESHOT

get_signal_to_deliver() already resets the signal handler if SA_ONESHOT is
set in ka->sa.sa_flags, there's no need to do it again in handle_signal().
Furthermore, because we were modifying ka->sa.sa_handler (which is a copy
of sighand->action[]) instead of sighand->action[] the original code had
no effect on signal delivery.

Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Matt Fleming and committed by
Paul Mundt
8368b0e0 b448d6ad

-6
-3
arch/sh/kernel/signal_32.c
··· 548 548 else 549 549 ret = setup_frame(sig, ka, oldset, regs); 550 550 551 - if (ka->sa.sa_flags & SA_ONESHOT) 552 - ka->sa.sa_handler = SIG_DFL; 553 - 554 551 if (ret == 0) { 555 552 spin_lock_irq(&current->sighand->siglock); 556 553 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
-3
arch/sh/kernel/signal_64.c
··· 734 734 else 735 735 ret = setup_frame(sig, ka, oldset, regs); 736 736 737 - if (ka->sa.sa_flags & SA_ONESHOT) 738 - ka->sa.sa_handler = SIG_DFL; 739 - 740 737 if (ret == 0) { 741 738 spin_lock_irq(&current->sighand->siglock); 742 739 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);