aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2009-03-26 13:03:08 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-01 11:13:17 -0400
commit0f8f308925ebe0480bd9831d32963ee0b885e24b (patch)
tree3a4bef09e978eb314b7172738bc92dfdfece65c3 /arch/x86/kernel/signal.c
parent93394a761d78503f11d05b1a7b23d5a9ccc8dad2 (diff)
x86: signal: check sas_ss_size instead of sas_ss_flags()
Impact: fix redundant and incorrect check Oleg Nesterov noticed wrt commit: 14fc9fb: x86: signal: check signal stack overflow properly >> No need to check SA_ONSTACK if we're already using alternate signal stack. > > Yes, but this also mean that we don't need sas_ss_flags() under > "if (!onsigstack)", Checking on_sig_stack() in sas_ss_flags() at get_sigframe() is redundant and not correct on 64 bit. To check sas_ss_size is enough. Reported-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Cc: roland@redhat.com LKML-Reference: <49CBB54C.5080201@ct.jp.nec.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index dfcc74ab0ab6..14425166b8e3 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -221,7 +221,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
221 if (!onsigstack) { 221 if (!onsigstack) {
222 /* This is the X/Open sanctioned signal stack switching. */ 222 /* This is the X/Open sanctioned signal stack switching. */
223 if (ka->sa.sa_flags & SA_ONSTACK) { 223 if (ka->sa.sa_flags & SA_ONSTACK) {
224 if (sas_ss_flags(sp) == 0) 224 if (current->sas_ss_size)
225 sp = current->sas_ss_sp + current->sas_ss_size; 225 sp = current->sas_ss_sp + current->sas_ss_size;
226 } else { 226 } else {
227#ifdef CONFIG_X86_32 227#ifdef CONFIG_X86_32