[PATCH] v850: signal handling race fix

From: Miles Bader
Date: Fri Oct 29 2004 - 03:22:37 EST


Signed-off-by: Miles Bader <miles@xxxxxxx>

arch/v850/kernel/signal.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)

diff -ruN -X../cludes linux-2.6.9-uc0/arch/v850/kernel/signal.c linux-2.6.9-uc0-v850-20041028/arch/v850/kernel/signal.c
--- linux-2.6.9-uc0/arch/v850/kernel/signal.c 2004-10-25 15:14:32 +0900
+++ linux-2.6.9-uc0-v850-20041028/arch/v850/kernel/signal.c 2004-10-28 13:32:47 +0900
@@ -427,11 +427,9 @@
*/

static void
-handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
- struct pt_regs * regs)
+handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
+ sigset_t *oldset, struct pt_regs * regs)
{
- struct k_sigaction *ka = &current->sighand->action[sig-1];
-
/* Are we from a system call? */
if (PT_REGS_SYSCALL (regs)) {
/* If so, check system call restarting.. */
@@ -464,9 +462,6 @@
else
setup_frame(sig, ka, oldset, regs);

- if (ka->sa.sa_flags & SA_ONESHOT)
- ka->sa.sa_handler = SIG_DFL;
-
if (!(ka->sa.sa_flags & SA_NODEFER)) {
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -489,6 +484,7 @@
{
siginfo_t info;
int signr;
+ struct k_sigaction ka;

/*
* We want the common case to go fast, which
@@ -502,10 +498,10 @@
if (!oldset)
oldset = &current->blocked;

- signr = get_signal_to_deliver(&info, regs, NULL);
+ signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
- handle_signal(signr, &info, oldset, regs);
+ handle_signal(signr, &info, &ka, oldset, regs);
return 1;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/