Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-19 Thread Shi Weihua
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

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-19 Thread Shi Weihua
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 ri

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-19 Thread Shi Weihua
riginal comment untouched. Sorry for my poor English. :( Thanks Shi Weihua -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-19 Thread Shi Weihua
n 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 >

Re: [PATCH 5/5] signal(ia64_ia32): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to ia64_ia32 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

Re: [PATCH 4/5] signal(ia64): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to ia64 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --

Re: [PATCH 3/5] signal(x86_ia32): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to x86_ia32 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

Re: [PATCH 2/5] signal(x86_64): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to x86_64 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-18 Thread Shi Weihua
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 <[EMAIL PROTECTED]> --- The previous patch has a comment mistake. Now I correct it. --- --- linux

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-18 Thread Shi Weihua
[EMAIL PROTECTED] 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 ^ >

Re: [PATCH 4/5] signal(ia64): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
Matthew Wilcox wrote:: > On Mon, Feb 18, 2008 at 06:26:23PM +0800, Shi Weihua wrote: >> +if (!rbs_on_sig_stack(scr->pt.ar_bspstore)) >> +new_rbs = (current->sas_ss_sp + >> + sizeof

Re: [PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-18 Thread Shi Weihua
Ingo Molnar wrote:: > * Shi Weihua <[EMAIL PROTECTED]> 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

[PATCH 5/5] signal(ia64_ia32): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to ia64_ia32 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

[PATCH 4/5] signal(ia64): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to ia64 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

[PATCH 2/5] signal(x86_64): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to x86_64 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

[PATCH 3/5] signal(x86_ia32): add a signal stack overflow check

2008-02-18 Thread Shi Weihua
The similar check has been added to x86_32(i386) in commit id 83bd01024b1fdfc41d9b758e5669e80fca72df66. So we add this check to x86_ia32 and improve it a liitle bit in that we need to check for stack overflow only when the signal is on stack. Signed-off-by: Shi Weihua <[EMAIL PROTEC

[PATCH 1/5] signal(x86_32): Improve the signal stack overflow check

2008-02-18 Thread Shi Weihua
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 <[EMAIL PROTECTED]> --- --- linux-2.6.25-rc2.orig/arch/x86/kernel/signal_32.c 2008-02-16 04:57:20

[PATCH 2.6.24-rt1] timer:fix build warning in timer.c

2008-02-14 Thread Shi Weihua
Fix the following compile warning without CONFIG_PREEMPT_RT: kernel/timer.c:937: warning: ‘count_active_rt_tasks’ defined but not used Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --- diff -urpN linux-2.6.24-rt1.orig/kernel/timer.c linux-2.6.24-rt1/kernel/timer.c --- linux-2.6.24-rt

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-12-04 Thread Shi Weihua
> I am sorry, i don't understand how this is related to the semantics of e.g. longjmp. But, i am sure my patch solves all overflows. Ingo's patch can't catch the overflow which is caught by "int i[1000];" in the handler function. Do you have more idea for me? Thanks.

[PATCH] IA64 signal : fix missing error checkings

2007-12-02 Thread Shi Weihua
Not all the return value of __copy_from_user and __put_user is checked.This patch fixed it. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --- diff -x '*.o*' -urp linux-2.6.24-rc3-git6.orig/arch/ia64/kernel/signal.c linux-2.6.24-rc3-git6/arch/ia64/kernel/signal.c --- linux-2.6.

Re: Fw: Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-11-27 Thread Shi Weihua
n"); return -1; } memset(&action, 0, sizeof(action)); action.sa_handler = segv_handler; action.sa_flags = SA_ONSTACK | SA_NODEFER; sigemptyset(&action.sa_mask); sigaction(SIGSEGV, &action, NULL); *c = 0; //SEGV if (!s) free(s);

[PATCH RFC][try 2] IA64 signal : remove redundant code in setup_sigcontext()

2007-11-21 Thread Shi Weihua
. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --- diff -urp linux-2.6.24-rc3-git1.orig/arch/ia64/kernel/signal.c linux-2.6.24-rc3-git1/arch/ia64/kernel/signal.c --- linux-2.6.24-rc3-git1.orig/arch/ia64/kernel/signal.c2007-11-17 13:16:36.0 +0800 +++ linux-2.6.24-rc3

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-11-18 Thread Shi Weihua
vice about storing the previous esp? Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --- diff -urpN linux-2.6.24-rc2.orig/arch/x86/kernel/signal_32.c linux-2.6.24-rc2/arch/x86/kernel/signal_32.c --- linux-2.6.24-rc2.orig/arch/x86/kernel/signal_32.c 2007-11-13 14:30:45.0 +0800 +++ linux

[PATCH] IA64 signal : remove redundant code in setup_sigcontext()

2007-11-18 Thread Shi Weihua
. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> --- diff -urp linux-2.6.24-rc2.orig/arch/ia64/kernel/signal.c linux-2.6.24-rc2/arch/ia64/kernel/signal.c --- linux-2.6.24-rc2.orig/arch/ia64/kernel/signal.c 2007-11-09 14:38:53.0 +0800 +++ linux-2.6.24-rc2/arch/ia64/kernel/signa

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-10-04 Thread Shi Weihua
Mikael Pettersson wrote:: On Thu, 4 Oct 2007 21:47:30 +0900, KAMEZAWA Hiroyuki wrote: On Thu, 04 Oct 2007 21:33:12 +0900 Shi Weihua <[EMAIL PROTECTED]> wrote: KAMEZAWA Hiroyuki wrote:: On Thu, 04 Oct 2007 20:56:14 +0900 Shi Weihua <[EMAIL PROTECTED]> wrote: stack.

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-10-04 Thread Shi Weihua
KAMEZAWA Hiroyuki wrote:: On Thu, 04 Oct 2007 20:56:14 +0900 Shi Weihua <[EMAIL PROTECTED]> wrote: stack.ss_sp = addr + pagesize; stack.ss_flags = 0; stack.ss_size = pagesize; Here is bad. stack,ss_sp = addr; stack.ss_flags = 0; stack.ss_size = pagesize * 2;

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-10-04 Thread Shi Weihua
ot;); return -1; } memset(&action, 0, sizeof(action)); action.sa_handler = segv_handler; action.sa_flags = SA_ONSTACK | SA_NODEFER; sigemptyset(&action.sa_mask); sigaction(SIGSEGV, &action, NULL); *c = 0;

Re: [PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-10-04 Thread Shi Weihua
Mikael Pettersson wrote:: On Wed, 03 Oct 2007 17:06:24 +0900, Shi Weihua wrote: Fixing alternative signal stack wraparound. If a process uses alternative signal stack by using sigaltstack() and that stack overflow, stack wraparound occurs. This patch checks whether the signal frame is on the

[PATCH 1/3] signal(i386): alternative signal stack wraparound occurs

2007-10-03 Thread Shi Weihua
process forcedly then the process will be terminated. This patch is for i386,version is 2.6.23-rc8. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> diff -pur linux-2.6.23-rc8.orig/arch/i386/kernel/signal.c linux-2.6.23-rc8/arch/i386/kernel/signal.c --- linux-2.6.23-rc8.orig/arch/i386/kernel/si

[PATCH 2/3] signal(ia64): alternative signal stack wraparound occurs

2007-10-03 Thread Shi Weihua
process forcedly then the process will be terminated. This patch is for ia64,version is 2.6.23-rc8. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> diff -pur linux-2.6.23-rc8.orig/arch/ia64/ia32/ia32_signal.c linux-2.6.23-rc8/arch/ia64/ia32/ia32_signal.c --- linux-2.6.23-rc8.orig/arch/ia6

[PATCH 3/3] signal(x86-64): alternative signal stack wraparound occurs

2007-10-03 Thread Shi Weihua
process forcedly then the process will be terminated. This patch is for x86-64,version is 2.6.23-rc8. Signed-off-by: Shi Weihua <[EMAIL PROTECTED]> diff -pur linux-2.6.23-rc8.orig/arch/x86_64/ia32/ia32_signal.c linux-2.6.23-rc8/arch/x86_64/ia32/ia32_signal.c --- linux-2.6.23-rc8.orig/arch/

[PATCH 0/3] signal: alternative signal stack wraparound occurs

2007-10-03 Thread Shi Weihua
+ int i[1000]; + int *c = NULL; counter++; printf("%d\n", counter); --- I think the "int i[1000];" make the signal frame not to be checked by the added code in my patch. But I don't know how