From: Max Filippov <jcmvbkbc@gmail.com>
To: Chris Zankel <chris@zankel.net>
Cc: Marc Gauthier <marc@tensilica.com>,
linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org,
Baruch Siach <baruch@tkos.co.il>,
stable@vger.kernel.org, Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCHv2 2/2] xtensa: don't use alternate signal stack on threads
Date: Sat, 26 Oct 2013 05:03:05 +0400 [thread overview]
Message-ID: <1382749385-29062-3-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1382749385-29062-1-git-send-email-jcmvbkbc@gmail.com>
From: Baruch Siach <baruch@tkos.co.il>
According to create_thread(3): "The new thread does not inherit the creating
thread's alternate signal stack". Since commit f9a3879a (Fix sigaltstack
corruption among cloned threads), current->sas_ss_size is set to 0 for cloned
processes sharing VM with their parent. Don't use the (nonexistent) alternate
signal stack in this case. This has been broken since commit 29c4dfd9 ([XTENSA]
Remove non-rt signal handling).
Fixes the SA_ONSTACK part of the nptl/tst-cancel20 test from uClibc.
Cc: <stable@vger.kernel.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
arch/xtensa/kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index 718eca1..98b67d5 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -341,7 +341,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sp = regs->areg[1];
- if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) {
+ if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) {
sp = current->sas_ss_sp + current->sas_ss_size;
}
--
1.8.1.4
prev parent reply other threads:[~2013-10-26 1:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-26 1:03 [PATCHv2 0/2] xtensa fixes for 3.12 Max Filippov
2013-10-26 1:03 ` [PATCHv2 1/2] xtensa: fix fast_syscall_spill_registers_fixup Max Filippov
2013-10-26 1:03 ` Max Filippov [this message]
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=1382749385-29062-3-git-send-email-jcmvbkbc@gmail.com \
--to=jcmvbkbc@gmail.com \
--cc=baruch@tkos.co.il \
--cc=chris@zankel.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=marc@tensilica.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).