The patch titled fix incorrect SA_ONSTACK behaviour for 64-bit processes has been removed from the -mm tree. Its filename is fix-incorrect-sa_onstack-behaviour-for-64-bit-processes.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: fix incorrect SA_ONSTACK behaviour for 64-bit processes 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. 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 --- a/arch/alpha/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/alpha/kernel/signal.c @@ -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 --- a/arch/frv/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/frv/kernel/signal.c @@ -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 --- a/arch/h8300/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/h8300/kernel/signal.c @@ -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 --- a/arch/m68k/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/m68k/kernel/signal.c @@ -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 --- a/arch/m68knommu/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/m68knommu/kernel/signal.c @@ -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 --- a/arch/parisc/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/parisc/kernel/signal.c @@ -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 --- a/arch/sh64/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/sh64/kernel/signal.c @@ -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 --- a/arch/v850/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/v850/kernel/signal.c @@ -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 --- a/arch/xtensa/kernel/signal.c~fix-incorrect-sa_onstack-behaviour-for-64-bit-processes +++ a/arch/xtensa/kernel/signal.c @@ -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 origin.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