The patch titled fix incorrect SA_ONSTACK behaviour for 64-bit processes has been added to the -mm tree. Its filename is fix-incorrect-sa_onstack-behaviour-for-64-bit-processes.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this From: Laurent MEYER <meyerlau@xxxxxxxxxx> - When setting a sighandler using sigaction() call, if the flag SA_ONSTACK is set and no alternate stack is provided via sigaltstack(), the kernel still try to install the alternate stack. This behavior is the opposite of the one which is documented in Single Unix Specifications V3. - Also when setting an alternate stack using sigaltstack() with the flag SS_DISABLE, the kernel try to install the alternate stack on signal delivery. These two use cases makes the process crash at signal delivery. [akpm: untested at time of submission] Signed-off-by: Laurent Meyer <meyerlau@xxxxxxxxxx> Cc: Richard Henderson <rth@xxxxxxxxxxx> Cc: Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx> Cc: David Howells <dhowells@xxxxxxxxxx> Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx> Cc: Kyle McMartin <kyle@xxxxxxxxxxx> Cc: Paul Mundt <lethal@xxxxxxxxxxxx> Cc: Kazumoto Kojima <kkojima@xxxxxxxxxxxxxx> Cc: Chris Zankel <chris@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/alpha/kernel/signal.c | 2 +- arch/frv/kernel/signal.c | 2 +- arch/h8300/kernel/signal.c | 2 +- arch/m68k/kernel/signal.c | 2 +- arch/m68knommu/kernel/signal.c | 2 +- arch/parisc/kernel/signal.c | 2 +- arch/sh64/kernel/signal.c | 2 +- arch/v850/kernel/signal.c | 2 +- arch/xtensa/kernel/signal.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff -puN arch/alpha/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/alpha/kernel/signal.c --- 25/arch/alpha/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/alpha/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -375,7 +375,7 @@ give_sigsegv: static inline void __user * get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) { - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void __user *)((sp - frame_size) & -32ul); diff -puN arch/frv/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/frv/kernel/signal.c --- 25/arch/frv/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/frv/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -233,7 +233,7 @@ static inline void __user *get_sigframe( /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { - if (! on_sig_stack(sp)) + if (! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; } diff -puN arch/h8300/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/h8300/kernel/signal.c --- 25/arch/h8300/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/h8300/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -307,7 +307,7 @@ get_sigframe(struct k_sigaction *ka, str /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { - if (!on_sig_stack(usp)) + if (!sas_ss_flags(usp)) usp = current->sas_ss_sp + current->sas_ss_size; } return (void *)((usp - frame_size) & -8UL); diff -puN arch/m68k/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/m68k/kernel/signal.c --- 25/arch/m68k/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/m68k/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -763,7 +763,7 @@ get_sigframe(struct k_sigaction *ka, str /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { - if (!on_sig_stack(usp)) + if (!sas_ss_flags(usp)) usp = current->sas_ss_sp + current->sas_ss_size; } return (void __user *)((usp - frame_size) & -8UL); diff -puN arch/m68knommu/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/m68knommu/kernel/signal.c --- 25/arch/m68knommu/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/m68knommu/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -553,7 +553,7 @@ get_sigframe(struct k_sigaction *ka, str /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { - if (!on_sig_stack(usp)) + if (!sas_ss_flags(usp)) usp = current->sas_ss_sp + current->sas_ss_size; } return (void *)((usp - frame_size) & -8UL); diff -puN arch/parisc/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/parisc/kernel/signal.c --- 25/arch/parisc/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/parisc/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -248,7 +248,7 @@ get_sigframe(struct k_sigaction *ka, uns DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n", (unsigned long)ka, sp, frame_size); - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp; /* Stacks grow up! */ DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp); diff -puN arch/sh64/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/sh64/kernel/signal.c --- 25/arch/sh64/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/sh64/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -407,7 +407,7 @@ setup_sigcontext(struct sigcontext __use static inline void __user * get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) { - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void __user *)((sp - frame_size) & -8ul); diff -puN arch/v850/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/v850/kernel/signal.c --- 25/arch/v850/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/v850/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -274,7 +274,7 @@ get_sigframe(struct k_sigaction *ka, str /* Default to using normal stack */ unsigned long sp = regs->gpr[GPR_SP]; - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void *)((sp - frame_size) & -8UL); diff -puN arch/xtensa/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes arch/xtensa/kernel/signal.c --- 25/arch/xtensa/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes Mon Apr 24 14:42:50 2006 +++ 25-akpm/arch/xtensa/kernel/signal.c Mon Apr 24 14:42:50 2006 @@ -433,7 +433,7 @@ badframe: static inline void * get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) { - if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) + if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void *)((sp - frame_size) & -16ul); _ Patches currently in -mm which might be from meyerlau@xxxxxxxxxx are fix-incorrect-sa_onstack-behaviour-for-64-bit-processes.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html