diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c index c5a952d19ff29d435d8e7e1fd0cbc00dd48e00b3..1e228bdc0e732075192e8f410da00ad50a8da21e 100644 --- a/arch/ppc64/kernel/signal.c +++ b/arch/ppc64/kernel/signal.c @@ -388,7 +388,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, return 0; } -static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, +static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { /* Handler is *really* a pointer to the function descriptor for @@ -456,7 +456,7 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); - return; + return 1; badframe: #if DEBUG_SIG @@ -464,25 +464,30 @@ static void setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info, regs, frame, newsp); #endif force_sigsegv(signr, current); + return 0; } /* * OK, we're invoking a handler */ -static void handle_signal(unsigned long sig, struct k_sigaction *ka, - siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) +static int handle_signal(unsigned long sig, struct k_sigaction *ka, + siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) { + int ret; + /* Set up Signal Frame */ - setup_rt_frame(sig, ka, info, oldset, regs); + ret = setup_rt_frame(sig, ka, info, oldset, regs); - if (!(ka->sa.sa_flags & SA_NODEFER)) { + if (ret && !(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); } + + return ret; } static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) @@ -542,8 +547,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (TRAP(regs) == 0x0C00) syscall_restart(regs, &ka); - handle_signal(signr, &ka, &info, oldset, regs); - return 1; + return handle_signal(signr, &ka, &info, oldset, regs); } if (TRAP(regs) == 0x0C00) { /* System Call! */ diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c index 59a5b6d73976408db37736de1c20f7d989aa8b7b..bdc0d624b86f5030a9c2f94e517c2491ad070fd7 100644 --- a/arch/ppc64/kernel/signal32.c +++ b/arch/ppc64/kernel/signal32.c @@ -650,9 +650,9 @@ int sys32_sigaltstack(u32 __new, u32 __old, int r5, * Set up a signal frame for a "real-time" signal handler * (one which gets siginfo). */ -static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, - siginfo_t *info, sigset_t *oldset, - struct pt_regs * regs, unsigned long newsp) +static int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, + siginfo_t *info, sigset_t *oldset, + struct pt_regs * regs, unsigned long newsp) { struct rt_sigframe32 __user *rt_sf; struct mcontext32 __user *frame; @@ -704,7 +704,7 @@ static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); - return; + return 1; badframe: #if DEBUG_SIG @@ -712,6 +712,7 @@ static void handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, regs, frame, newsp); #endif force_sigsegv(sig, current); + return 0; } static long do_setcontext32(struct ucontext32 __user *ucp, struct pt_regs *regs, int sig) @@ -822,7 +823,7 @@ long sys32_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, /* * OK, we're invoking a handler */ -static void handle_signal32(unsigned long sig, struct k_sigaction *ka, +static int handle_signal32(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, struct pt_regs * regs, unsigned long newsp) { @@ -870,7 +871,7 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka, if (test_thread_flag(TIF_SINGLESTEP)) ptrace_notify(SIGTRAP); - return; + return 1; badframe: #if DEBUG_SIG @@ -878,6 +879,7 @@ static void handle_signal32(unsigned long sig, struct k_sigaction *ka, regs, frame, *newspp); #endif force_sigsegv(sig, current); + return 0; } /* @@ -987,11 +989,11 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) /* Whee! Actually deliver the signal. */ if (ka.sa.sa_flags & SA_SIGINFO) - handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp); + ret = handle_rt_signal32(signr, &ka, &info, oldset, regs, newsp); else - handle_signal32(signr, &ka, &info, oldset, regs, newsp); + ret = handle_signal32(signr, &ka, &info, oldset, regs, newsp); - if (!(ka.sa.sa_flags & SA_NODEFER)) { + if (ret && !(ka.sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); sigorsets(¤t->blocked, ¤t->blocked, &ka.sa.sa_mask); @@ -1000,5 +1002,5 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) spin_unlock_irq(¤t->sighand->siglock); } - return 1; + return ret; }