From: Stas Sergeev <stsp@list.ru>
To: Linux kernel <linux-kernel@vger.kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
Chen Liqin <liqin.linux@gmail.com>,
Lennox Wu <lennox.wu@gmail.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Andrew Morton <akpm@linux-foundation.org>,
James Hogan <james.hogan@imgtec.com>
Subject: [PATCH 2/4] score: signal: fix sigaltstack check
Date: Sun, 31 Jan 2016 19:21:15 +0300 [thread overview]
Message-ID: <56AE347B.5020303@list.ru> (raw)
In-Reply-To: <56AE3369.2090709@list.ru>
Currently get_sigframe() checks only
(ka->sa.sa_flags & SA_ONSTACK) && (!on_sig_stack(sp))
to determine whether the switch to sigaltstack is needed.
It forgets to checks whether the sigaltstack was previously set.
This patch replaces the !on_sig_stack(sp) with the standard check
sas_ss_flags(sp) == 0
that takes into account both conditions: it succeeds only if the
sigaltstack is enabled but currently not active.
CC: Andy Lutomirski <luto@amacapital.net>
CC: linux-kernel@vger.kernel.org
CC: Chen Liqin <liqin.linux@gmail.com>
CC: Lennox Wu <lennox.wu@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>
---
arch/score/kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c
index e381c8c..bd1c7c8 100644
--- a/arch/score/kernel/signal.c
+++ b/arch/score/kernel/signal.c
@@ -127,7 +127,7 @@ static void __user *get_sigframe(struct k_sigaction *ka,
sp -= 32;
/* This is the X/Open sanctioned signal stack switching. */
- if ((ka->sa.sa_flags & SA_ONSTACK) && (!on_sig_stack(sp)))
+ if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
sp = current->sas_ss_sp + current->sas_ss_size;
return (void __user*)((sp - frame_size) & ~7);
--
2.5.0
next prev parent reply other threads:[~2016-01-31 16:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-31 16:16 [PATCH 0/4] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-01-31 16:18 ` [PATCH 1/4] selftests: Add test for sigaltstack(SS_DISABLE) inside sighandler Stas Sergeev
2016-02-12 16:12 ` Shuah Khan
2016-02-12 16:17 ` Stas Sergeev
2016-01-31 16:21 ` Stas Sergeev [this message]
2016-02-02 19:07 ` [PATCH 2/4] score: signal: fix sigaltstack check Lennox Wu
2016-01-31 16:24 ` [PATCH 3/4] x86: signal: unify the sigaltstack check with other arches Stas Sergeev
2016-01-31 16:58 ` Andy Lutomirski
2016-01-31 18:03 ` Stas Sergeev
2016-01-31 16:28 ` [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler Stas Sergeev
2016-01-31 17:00 ` Andy Lutomirski
2016-01-31 17:33 ` Stas Sergeev
2016-01-31 19:03 ` Andy Lutomirski
2016-01-31 20:08 ` Stas Sergeev
2016-01-31 20:11 ` Andy Lutomirski
2016-01-31 22:36 ` Stas Sergeev
2016-01-31 22:44 ` Andy Lutomirski
2016-01-31 23:45 ` Stas Sergeev
2016-02-01 16:06 ` Oleg Nesterov
2016-02-01 16:57 ` Stas Sergeev
2016-02-01 17:27 ` Oleg Nesterov
2016-02-01 17:09 ` Oleg Nesterov
2016-02-01 17:26 ` Stas Sergeev
2016-02-01 18:04 ` Oleg Nesterov
2016-02-01 18:16 ` Stas Sergeev
2016-02-01 18:28 ` Andy Lutomirski
2016-02-01 18:40 ` Stas Sergeev
2016-02-01 18:52 ` Oleg Nesterov
2016-02-01 19:01 ` Stas Sergeev
2016-02-01 19:29 ` Oleg Nesterov
2016-02-01 19:46 ` Stas Sergeev
2016-02-01 20:41 ` Oleg Nesterov
2016-02-01 23:06 ` Stas Sergeev
2016-01-31 19:10 [PATCH v2 0/4] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-01-31 19:14 ` [PATCH 2/4] score: signal: fix sigaltstack check Stas Sergeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56AE347B.5020303@list.ru \
--to=stsp@list.ru \
--cc=akpm@linux-foundation.org \
--cc=james.hogan@imgtec.com \
--cc=lennox.wu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liqin.linux@gmail.com \
--cc=luto@amacapital.net \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome