Skip to content

Commit cba9a90

Browse files
baruchsiachczankel
authored andcommitted
xtensa: don't use alternate signal stack on threads
According to create_thread(3): "The new thread does not inherit the creating thread's alternate signal stack". Since commit f9a3879 (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 29c4dfd ([XTENSA] Remove non-rt signal handling). Fixes the SA_ONSTACK part of the nptl/tst-cancel20 test from uClibc. Cc: <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Max Filippov <[email protected]> Signed-off-by: Chris Zankel <[email protected]>
1 parent 244066f commit cba9a90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/xtensa/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
341341

342342
sp = regs->areg[1];
343343

344-
if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) {
344+
if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) {
345345
sp = current->sas_ss_sp + current->sas_ss_size;
346346
}
347347

0 commit comments

Comments
 (0)