* [PATCH 3/6] avr32: fix handling of blocked signals
@ 2010-09-28 2:57 Al Viro
2010-09-28 2:57 ` Al Viro
2010-11-01 8:06 ` Hans-Christian Egtvedt
0 siblings, 2 replies; 3+ messages in thread
From: Al Viro @ 2010-09-28 2:57 UTC (permalink / raw)
To: hans-christian.egtvedt; +Cc: torvalds, linux-kernel, linux-arch
We do _not_ want to block anything on failure to set sigframe up
and we do not want to ignore sa_mask even when SA_NODOFER is set.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/avr32/kernel/signal.c | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
index 8c481fb..52affae 100644
--- a/arch/avr32/kernel/signal.c
+++ b/arch/avr32/kernel/signal.c
@@ -231,28 +231,24 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
/*
* Set up the stack frame
*/
- ret = setup_rt_frame(sig, ka, info, oldset, regs);
+ if (setup_rt_frame(sig, ka, info, oldset, regs) != 0)
+ goto fail;
/*
* Check that the resulting registers are sane
*/
- ret |= !valid_user_regs(regs);
+ if (!valid_user_regs(regs))
+ goto fail;
- /*
- * Block the signal if we were unsuccessful.
- */
- if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) {
- spin_lock_irq(¤t->sighand->siglock);
- sigorsets(¤t->blocked, ¤t->blocked,
- &ka->sa.sa_mask);
+ spin_lock_irq(¤t->sighand->siglock);
+ sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(¤t->blocked, sig);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
- }
-
- if (ret == 0)
- return;
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
+ return;
+fail:
force_sigsegv(sig, current);
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/6] avr32: fix handling of blocked signals
2010-09-28 2:57 [PATCH 3/6] avr32: fix handling of blocked signals Al Viro
@ 2010-09-28 2:57 ` Al Viro
2010-11-01 8:06 ` Hans-Christian Egtvedt
1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2010-09-28 2:57 UTC (permalink / raw)
To: hans-christian.egtvedt; +Cc: torvalds, linux-kernel, linux-arch
We do _not_ want to block anything on failure to set sigframe up
and we do not want to ignore sa_mask even when SA_NODOFER is set.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/avr32/kernel/signal.c | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
index 8c481fb..52affae 100644
--- a/arch/avr32/kernel/signal.c
+++ b/arch/avr32/kernel/signal.c
@@ -231,28 +231,24 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
/*
* Set up the stack frame
*/
- ret = setup_rt_frame(sig, ka, info, oldset, regs);
+ if (setup_rt_frame(sig, ka, info, oldset, regs) != 0)
+ goto fail;
/*
* Check that the resulting registers are sane
*/
- ret |= !valid_user_regs(regs);
+ if (!valid_user_regs(regs))
+ goto fail;
- /*
- * Block the signal if we were unsuccessful.
- */
- if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) {
- spin_lock_irq(¤t->sighand->siglock);
- sigorsets(¤t->blocked, ¤t->blocked,
- &ka->sa.sa_mask);
+ spin_lock_irq(¤t->sighand->siglock);
+ sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(¤t->blocked, sig);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
- }
-
- if (ret == 0)
- return;
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
+ return;
+fail:
force_sigsegv(sig, current);
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3/6] avr32: fix handling of blocked signals
2010-09-28 2:57 [PATCH 3/6] avr32: fix handling of blocked signals Al Viro
2010-09-28 2:57 ` Al Viro
@ 2010-11-01 8:06 ` Hans-Christian Egtvedt
1 sibling, 0 replies; 3+ messages in thread
From: Hans-Christian Egtvedt @ 2010-11-01 8:06 UTC (permalink / raw)
To: Al Viro; +Cc: torvalds, linux-kernel, linux-arch
On Tue, 2010-09-28 at 03:57 +0100, Al Viro wrote:
> We do _not_ want to block anything on failure to set sigframe up
> and we do not want to ignore sa_mask even when SA_NODOFER is set.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> arch/avr32/kernel/signal.c | 26 +++++++++++---------------
> 1 files changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
> index 8c481fb..52affae 100644
> --- a/arch/avr32/kernel/signal.c
> +++ b/arch/avr32/kernel/signal.c
> @@ -231,28 +231,24 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
> /*
> * Set up the stack frame
> */
> - ret = setup_rt_frame(sig, ka, info, oldset, regs);
Nuke the local ret variable in the same go.
<snipp>
--
Hans-Christian Egtvedt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-01 8:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 2:57 [PATCH 3/6] avr32: fix handling of blocked signals Al Viro
2010-09-28 2:57 ` Al Viro
2010-11-01 8:06 ` Hans-Christian Egtvedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).