x86: signal: check sas_ss_size instead of sas_ss_flags()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 6:04 pm

Gitweb:     http://git.kernel.org/linus/0f8f308925ebe0480bd9831d32963ee0b885e24b
Commit:     0f8f308925ebe0480bd9831d32963ee0b885e24b
Parent:     93394a761d78503f11d05b1a7b23d5a9ccc8dad2
Author:     Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
AuthorDate: Thu Mar 26 10:03:08 2009 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed Apr 1 17:13:17 2009 +0200

    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>
---
 arch/x86/kernel/signal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index dfcc74a..1442516 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,
 	if (!onsigstack) {
 		/* This is the X/Open sanctioned signal stack switching.  */
 		if (ka->sa.sa_flags & SA_ONSTACK) {
-			if (sas_ss_flags(sp) == 0)
+			if (current->sas_ss_size)
 				sp = current->sas_ss_sp + current->sas_ss_size;
 		} else {
 #ifdef CONFIG_X86_32
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86: signal: check sas_ss_size instead of sas_ss_flags(), Linux Kernel Mailing ..., (Fri Apr 3, 6:04 pm)