linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
@ 2008-02-18 10:22 Shi Weihua
  2008-02-18 13:47 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Shi Weihua @ 2008-02-18 10:22 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin

We need to check for stack overflow only when the signal is on stack.
So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as following. 

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com> 

---
--- linux-2.6.25-rc2.orig/arch/x86/kernel/signal_32.c	2008-02-16 04:57:20.000000000 +0800
+++ linux-2.6.25-rc2/arch/x86/kernel/signal_32.c	2008-02-18 18:06:39.000000000 +0800
@@ -299,17 +299,21 @@ get_sigframe(struct k_sigaction *ka, str
 	/* Default to using normal stack */
 	sp = regs->sp;
 
-	/*
-	 * If we are on the alternate signal stack and would overflow it, don't.
-	 * Return an always-bogus address instead so we will die with SIGSEGV.
-	 */
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
-		return (void __user *) -1L;
-
 	/* This is the X/Open sanctioned signal stack switching.  */
 	if (ka->sa.sa_flags & SA_ONSTACK) {
-		if (sas_ss_flags(sp) == 0)
+		int onstack = sas_ss_flags(sp);
+
+		if (onstack == 0)
 			sp = current->sas_ss_sp + current->sas_ss_size;
+		else if (onstack == SS_ONSTACK) {
+			/*
+			 * If we are on the alternate signal stack and would
+			 * overflow it, don't return an always-bogus address
+			 * instead so we will die with SIGSEGV.
+			 */
+			if (!likely(on_sig_stack(sp - frame_size)))
+				return (void __user *) -1L;
+		}
 	}
 
 	/* This is the legacy signal stack switching. */


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-18 10:22 [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check Shi Weihua
@ 2008-02-18 13:47 ` Ingo Molnar
  2008-02-19  0:58   ` Shi Weihua
  2008-02-18 18:05 ` Valdis.Kletnieks
  2008-02-19  2:19 ` Shi Weihua
  2 siblings, 1 reply; 22+ messages in thread
From: Ingo Molnar @ 2008-02-18 13:47 UTC (permalink / raw)
  To: Shi Weihua; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin, Roland McGrath


* Shi Weihua <shiwh@cn.fujitsu.com> wrote:

> We need to check for stack overflow only when the signal is on stack. 
> So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as 
> following.

hm, does this address Roland's observations at:

   http://lkml.org/lkml/2007/11/28/13

?

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-18 10:22 [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check Shi Weihua
  2008-02-18 13:47 ` Ingo Molnar
@ 2008-02-18 18:05 ` Valdis.Kletnieks
  2008-02-19  2:11   ` Shi Weihua
  2008-02-19  2:19 ` Shi Weihua
  2 siblings, 1 reply; 22+ messages in thread
From: Valdis.Kletnieks @ 2008-02-18 18:05 UTC (permalink / raw)
  To: Shi Weihua; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On Mon, 18 Feb 2008 18:22:05 +0800, Shi Weihua said:

> -	/*
> -	 * If we are on the alternate signal stack and would overflow it, don't.
                                                                   notice this ^
> -	 * Return an always-bogus address instead so we will die with SIGSEGV.

> +			 * If we are on the alternate signal stack and would
> +			 * overflow it, don't return an always-bogus address
                                missing here ^
> +			 * instead so we will die with SIGSEGV.

"don't. Return" is a vastly different semantic than "don't return".

I think the same comment error was cut-n-pasted into all 5 patches...


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-18 13:47 ` Ingo Molnar
@ 2008-02-19  0:58   ` Shi Weihua
  2008-02-19 18:50     ` Roland McGrath
  0 siblings, 1 reply; 22+ messages in thread
From: Shi Weihua @ 2008-02-19  0:58 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin, Roland McGrath



Ingo Molnar wrote::
> * Shi Weihua <shiwh@cn.fujitsu.com> wrote:
> 
>> We need to check for stack overflow only when the signal is on stack. 
>> So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as 
>> following.
> 
> hm, does this address Roland's observations at:
> 
>    http://lkml.org/lkml/2007/11/28/13
> 
> ?

Yes. please check it.

> 
> 	Ingo
> 
> 
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-18 18:05 ` Valdis.Kletnieks
@ 2008-02-19  2:11   ` Shi Weihua
  0 siblings, 0 replies; 22+ messages in thread
From: Shi Weihua @ 2008-02-19  2:11 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin



Valdis.Kletnieks@vt.edu wrote::
> On Mon, 18 Feb 2008 18:22:05 +0800, Shi Weihua said:
> 
>> -	/*
>> -	 * If we are on the alternate signal stack and would overflow it, don't.
>                                                                    notice this ^
>> -	 * Return an always-bogus address instead so we will die with SIGSEGV.
> 
>> +			 * If we are on the alternate signal stack and would
>> +			 * overflow it, don't return an always-bogus address
>                                 missing here ^
>> +			 * instead so we will die with SIGSEGV.
> 
> "don't. Return" is a vastly different semantic than "don't return".
> 
> I think the same comment error was cut-n-pasted into all 5 patches...
> 

Sorry, it's my mistake.
I will correct the all 5 patches. Thanks.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-18 10:22 [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check Shi Weihua
  2008-02-18 13:47 ` Ingo Molnar
  2008-02-18 18:05 ` Valdis.Kletnieks
@ 2008-02-19  2:19 ` Shi Weihua
  2008-02-19 11:05   ` Ingo Molnar
  2 siblings, 1 reply; 22+ messages in thread
From: Shi Weihua @ 2008-02-19  2:19 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin

We need to check for stack overflow only when the signal is on stack.
So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as following. 

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com> 

---

The previous patch has a comment mistake. Now I correct it.

---
--- linux-2.6.25-rc2.orig/arch/x86/kernel/signal_32.c	2008-02-16 04:57:20.000000000 +0800
+++ linux-2.6.25-rc2/arch/x86/kernel/signal_32.c	2008-02-19 09:55:59.000000000 +0800
@@ -299,17 +299,21 @@ get_sigframe(struct k_sigaction *ka, str
 	/* Default to using normal stack */
 	sp = regs->sp;
 
-	/*
-	 * If we are on the alternate signal stack and would overflow it, don't.
-	 * Return an always-bogus address instead so we will die with SIGSEGV.
-	 */
-	if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size)))
-		return (void __user *) -1L;
-
 	/* This is the X/Open sanctioned signal stack switching.  */
 	if (ka->sa.sa_flags & SA_ONSTACK) {
-		if (sas_ss_flags(sp) == 0)
+		int onstack = sas_ss_flags(sp);
+
+		if (onstack == 0)
 			sp = current->sas_ss_sp + current->sas_ss_size;
+		else if (onstack == SS_ONSTACK) {
+			/*
+			 * If we are on the alternate signal stack and would
+			 * overflow it, don't. Return an always-bogus address
+			 * instead so we will die with SIGSEGV.
+			 */
+			if (!likely(on_sig_stack(sp - frame_size)))
+				return (void __user *) -1L;
+		}
 	}
 
 	/* This is the legacy signal stack switching. */


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19  2:19 ` Shi Weihua
@ 2008-02-19 11:05   ` Ingo Molnar
  2008-02-19 23:21     ` Paul Mackerras
  0 siblings, 1 reply; 22+ messages in thread
From: Ingo Molnar @ 2008-02-19 11:05 UTC (permalink / raw)
  To: Shi Weihua; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin, Roland McGrath


* Shi Weihua <shiwh@cn.fujitsu.com> wrote:

> We need to check for stack overflow only when the signal is on stack. 
> So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as 
> following.

thanks, applied.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19  0:58   ` Shi Weihua
@ 2008-02-19 18:50     ` Roland McGrath
  2008-02-20  0:49       ` Shi Weihua
  0 siblings, 1 reply; 22+ messages in thread
From: Roland McGrath @ 2008-02-19 18:50 UTC (permalink / raw)
  To: Shi Weihua; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

This change looks bogus to me.  Before I get to the content, there is a nit
that annoys me.  You changed the punctuation in my comment so that it no
longer means what it did, and now the comment is nonsensical.  I don't
demand decent English from hackers of any linguistic bent, but please don't
louse up the coherent sentences I wrote when moving them down ten lines.

Please elaborate on the rationale that justifies this change.
I don't see it at all.

If you are already on the signal stack, it doesn't matter whether the
signal that just arrived has SA_ONSTACK set or not.  If you are going to
overflow the stack with the new signal frame, we want to prevent that
clobberation regardless.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19 11:05   ` Ingo Molnar
@ 2008-02-19 23:21     ` Paul Mackerras
  2008-02-19 23:25       ` H. Peter Anvin
  2008-02-20  0:04       ` Roland McGrath
  0 siblings, 2 replies; 22+ messages in thread
From: Paul Mackerras @ 2008-02-19 23:21 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Shi Weihua, linux-kernel, Thomas Gleixner, H. Peter Anvin,
	Roland McGrath, torvalds

Ingo Molnar writes:
> 
> * Shi Weihua <shiwh@cn.fujitsu.com> wrote:
> 
> > We need to check for stack overflow only when the signal is on stack. 
> > So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as 
> > following.
> 
> thanks, applied.

These patches change the behaviour of programs that longjmp out of a
signal handler on an alternate stack, don't they?

I'm interested to know what gave you confidence that changing that
behaviour won't break existing working programs.

Paul.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19 23:21     ` Paul Mackerras
@ 2008-02-19 23:25       ` H. Peter Anvin
  2008-02-20  0:03         ` Roland McGrath
  2008-02-20  0:04       ` Roland McGrath
  1 sibling, 1 reply; 22+ messages in thread
From: H. Peter Anvin @ 2008-02-19 23:25 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Ingo Molnar, Shi Weihua, linux-kernel, Thomas Gleixner,
	Roland McGrath, torvalds

Paul Mackerras wrote:
> Ingo Molnar writes:
>> * Shi Weihua <shiwh@cn.fujitsu.com> wrote:
>>
>>> We need to check for stack overflow only when the signal is on stack. 
>>> So we can improve the patch "http://lkml.org/lkml/2007/11/27/101" as 
>>> following.
>> thanks, applied.
> 
> These patches change the behaviour of programs that longjmp out of a
> signal handler on an alternate stack, don't they?
> 
> I'm interested to know what gave you confidence that changing that
> behaviour won't break existing working programs.
> 

Shouldn't such programs use sigsetjmp/siglongjmp, which should reset the 
signal stack state?

	-hpa

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19 23:25       ` H. Peter Anvin
@ 2008-02-20  0:03         ` Roland McGrath
  0 siblings, 0 replies; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  0:03 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Paul Mackerras, Ingo Molnar, Shi Weihua, linux-kernel,
	Thomas Gleixner, torvalds

> Shouldn't such programs use sigsetjmp/siglongjmp, which should reset the 
> signal stack state?

That is not really related.  The distinction doesn't really exist for
programs using the normal API (setjmp is sigsetjmp(,1)).  What siglongjmp
guarantees handled is signal mask changes, not sigaltstack.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19 23:21     ` Paul Mackerras
  2008-02-19 23:25       ` H. Peter Anvin
@ 2008-02-20  0:04       ` Roland McGrath
  1 sibling, 0 replies; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  0:04 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Ingo Molnar, Shi Weihua, linux-kernel, Thomas Gleixner,
	H. Peter Anvin, torvalds

> These patches change the behaviour of programs that longjmp out of a
> signal handler on an alternate stack, don't they?

No, they don't.  Shi Weihua's original patch had that problem.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-19 18:50     ` Roland McGrath
@ 2008-02-20  0:49       ` Shi Weihua
  2008-02-20  1:18         ` Roland McGrath
  0 siblings, 1 reply; 22+ messages in thread
From: Shi Weihua @ 2008-02-20  0:49 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

Roland McGrath wrote::
> This change looks bogus to me.  Before I get to the content, there is a nit
> that annoys me.  You changed the punctuation in my comment so that it no
> longer means what it did, and now the comment is nonsensical.  I don't
> demand decent English from hackers of any linguistic bent, but please don't
> louse up the coherent sentences I wrote when moving them down ten lines.
> 
> Please elaborate on the rationale that justifies this change.
> I don't see it at all.

I have corrected the comment in the latest patch which has been apllied by Ingo.
Please refer to http://lkml.org/lkml/2008/2/18/575 and http://lkml.org/lkml/2008/2/19/119 .

Thanks.
Shi Weihua

> 
> If you are already on the signal stack, it doesn't matter whether the
> signal that just arrived has SA_ONSTACK set or not.  If you are going to
> overflow the stack with the new signal frame, we want to prevent that
> clobberation regardless.
> 
> 
> Thanks,
> Roland
> 
> 
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  0:49       ` Shi Weihua
@ 2008-02-20  1:18         ` Roland McGrath
  2008-02-20  1:35           ` Shi Weihua
  0 siblings, 1 reply; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  1:18 UTC (permalink / raw)
  To: Shi Weihua; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

> > Please elaborate on the rationale that justifies this change.
> > I don't see it at all.
> 
> I have corrected the comment in the latest patch which has been apllied by Ingo.
> Please refer to http://lkml.org/lkml/2008/2/18/575 and http://lkml.org/lkml/2008/2/19/119 .

You have yet to say anything to justify your change.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  1:18         ` Roland McGrath
@ 2008-02-20  1:35           ` Shi Weihua
  2008-02-20  1:44             ` Roland McGrath
  0 siblings, 1 reply; 22+ messages in thread
From: Shi Weihua @ 2008-02-20  1:35 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

Roland McGrath wrote::
>>> Please elaborate on the rationale that justifies this change.
>>> I don't see it at all.
>> I have corrected the comment in the latest patch which has been apllied by Ingo.
>> Please refer to http://lkml.org/lkml/2008/2/18/575 and http://lkml.org/lkml/2008/2/19/119 .
> 
> You have yet to say anything to justify your change.

You mean the comment?

I mean I made a mistake about the comment so I changed it, and then
Valdis.Kletnieks pointed it out for me. And late I sent a revised
patch with your original comment untouched.

Sorry for my poor English.  :( 

Thanks
Shi Weihua


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  1:35           ` Shi Weihua
@ 2008-02-20  1:44             ` Roland McGrath
  2008-02-20  2:23               ` Shi Weihua
  0 siblings, 1 reply; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  1:44 UTC (permalink / raw)
  To: Shi Weihua; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

> You mean the comment?

No, that is trivial and already corrected.  I mean the substance of your
most recent patch.  I described why I think it is wrong.  You did not respond.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  1:44             ` Roland McGrath
@ 2008-02-20  2:23               ` Shi Weihua
  2008-02-20  2:49                 ` Roland McGrath
  0 siblings, 1 reply; 22+ messages in thread
From: Shi Weihua @ 2008-02-20  2:23 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

Roland McGrath wrote::
>> You mean the comment?
> 
> No, that is trivial and already corrected.  I mean the substance of your
> most recent patch.  I described why I think it is wrong.  You did not respond.

I spent some time read you mail carefully and dig into the code again.

And yes, you are right. It's possible that SA_ONSTACK has been cleared
before the second signal on the same stack comes.

So this patch is wrong  :( . I will revise the other 4 patches.

Sorry for the noise.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  2:23               ` Shi Weihua
@ 2008-02-20  2:49                 ` Roland McGrath
  2008-02-20  2:59                   ` Shi Weihua
                                     ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  2:49 UTC (permalink / raw)
  To: Shi Weihua; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

> I spent some time read you mail carefully and dig into the code again.
> 
> And yes, you are right. It's possible that SA_ONSTACK has been cleared
> before the second signal on the same stack comes.

It's not necessary for SA_ONSTACK to have "been cleared", by which I assume
you mean a sigaction call with SA_ONSTACK not set in sa_flags.  That is
indeed possible, but it's not the only case your patch broke.  It can just
be a different signal whose sigaction never had SA_ONSTACK, when you are
still on the signal stack from an earlier signal that did have SA_ONSTACK.

> So this patch is wrong  :( . I will revise the other 4 patches.

For 2 and 3, I would rather just wait until we unify signal.c anyway.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  2:49                 ` Roland McGrath
@ 2008-02-20  2:59                   ` Shi Weihua
  2008-02-20  5:54                   ` Harvey Harrison
  2008-02-20 10:27                   ` Ingo Molnar
  2 siblings, 0 replies; 22+ messages in thread
From: Shi Weihua @ 2008-02-20  2:59 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

Roland McGrath wrote::
>> I spent some time read you mail carefully and dig into the code again.
>>
>> And yes, you are right. It's possible that SA_ONSTACK has been cleared
>> before the second signal on the same stack comes.
> 
> It's not necessary for SA_ONSTACK to have "been cleared", by which I assume
> you mean a sigaction call with SA_ONSTACK not set in sa_flags.  That is
> indeed possible, but it's not the only case your patch broke.  It can just
> be a different signal whose sigaction never had SA_ONSTACK, when you are
> still on the signal stack from an earlier signal that did have SA_ONSTACK.

Thanks for your explanation.

> 
>> So this patch is wrong  :( . I will revise the other 4 patches.
> 
> For 2 and 3, I would rather just wait until we unify signal.c anyway.

Ok. I see.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  2:49                 ` Roland McGrath
  2008-02-20  2:59                   ` Shi Weihua
@ 2008-02-20  5:54                   ` Harvey Harrison
  2008-02-20  7:59                     ` Roland McGrath
  2008-02-20 10:27                   ` Ingo Molnar
  2 siblings, 1 reply; 22+ messages in thread
From: Harvey Harrison @ 2008-02-20  5:54 UTC (permalink / raw)
  To: Roland McGrath
  Cc: Shi Weihua, Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

On Tue, 2008-02-19 at 18:49 -0800, Roland McGrath wrote:
> > I spent some time read you mail carefully and dig into the code again.
> > 
> > And yes, you are right. It's possible that SA_ONSTACK has been cleared
> > before the second signal on the same stack comes.
> 
> It's not necessary for SA_ONSTACK to have "been cleared", by which I assume
> you mean a sigaction call with SA_ONSTACK not set in sa_flags.  That is
> indeed possible, but it's not the only case your patch broke.  It can just
> be a different signal whose sigaction never had SA_ONSTACK, when you are
> still on the signal stack from an earlier signal that did have SA_ONSTACK.
> 
> > So this patch is wrong  :( . I will revise the other 4 patches.
> 
> For 2 and 3, I would rather just wait until we unify signal.c anyway.
> 

I've been looking at that, at the same time a bunch of ia32/signal.c
looks like it can go away.

Harvey


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  5:54                   ` Harvey Harrison
@ 2008-02-20  7:59                     ` Roland McGrath
  0 siblings, 0 replies; 22+ messages in thread
From: Roland McGrath @ 2008-02-20  7:59 UTC (permalink / raw)
  To: Harvey Harrison
  Cc: Shi Weihua, Ingo Molnar, linux-kernel, Thomas Gleixner, H. Peter Anvin

> I've been looking at that, at the same time a bunch of ia32/signal.c
> looks like it can go away.

Yes, I meant the 3 into 1 unification.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check
  2008-02-20  2:49                 ` Roland McGrath
  2008-02-20  2:59                   ` Shi Weihua
  2008-02-20  5:54                   ` Harvey Harrison
@ 2008-02-20 10:27                   ` Ingo Molnar
  2 siblings, 0 replies; 22+ messages in thread
From: Ingo Molnar @ 2008-02-20 10:27 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Shi Weihua, linux-kernel, Thomas Gleixner, H. Peter Anvin


* Roland McGrath <roland@redhat.com> wrote:

> > I spent some time read you mail carefully and dig into the code again.
> > 
> > And yes, you are right. It's possible that SA_ONSTACK has been cleared
> > before the second signal on the same stack comes.
> 
> It's not necessary for SA_ONSTACK to have "been cleared", by which I 
> assume you mean a sigaction call with SA_ONSTACK not set in sa_flags.  
> That is indeed possible, but it's not the only case your patch broke.  
> It can just be a different signal whose sigaction never had 
> SA_ONSTACK, when you are still on the signal stack from an earlier 
> signal that did have SA_ONSTACK.
> 
> > So this patch is wrong :( . I will revise the other 4 patches.
> 
> For 2 and 3, I would rather just wait until we unify signal.c anyway.

ok, i've removed these patches from x86.git#testing for now:

 Subject: x86: improve the signal stack overflow logic, 32-bit
 Subject: x86: add a signal stack overflow check, 64-bit
 Subject: x86: add signal stack overflow check, 32-bit

and will wait for a resubmission and an Ack from Roland.

	Ingo

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-02-20 10:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-18 10:22 [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check Shi Weihua
2008-02-18 13:47 ` Ingo Molnar
2008-02-19  0:58   ` Shi Weihua
2008-02-19 18:50     ` Roland McGrath
2008-02-20  0:49       ` Shi Weihua
2008-02-20  1:18         ` Roland McGrath
2008-02-20  1:35           ` Shi Weihua
2008-02-20  1:44             ` Roland McGrath
2008-02-20  2:23               ` Shi Weihua
2008-02-20  2:49                 ` Roland McGrath
2008-02-20  2:59                   ` Shi Weihua
2008-02-20  5:54                   ` Harvey Harrison
2008-02-20  7:59                     ` Roland McGrath
2008-02-20 10:27                   ` Ingo Molnar
2008-02-18 18:05 ` Valdis.Kletnieks
2008-02-19  2:11   ` Shi Weihua
2008-02-19  2:19 ` Shi Weihua
2008-02-19 11:05   ` Ingo Molnar
2008-02-19 23:21     ` Paul Mackerras
2008-02-19 23:25       ` H. Peter Anvin
2008-02-20  0:03         ` Roland McGrath
2008-02-20  0:04       ` Roland McGrath

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).