# Re: \[PATCH v7 5/6\] x86/signal: Detect and prevent an alternate signal stack overflow

- From: Borislav Petkov \<hidden\>
- Date: 2021-03-25 21:28:37 
- List: linux-arch
- Page: https://ratatoskr.run/linux-arch/2021/03/6315864
- Thread: https://ratatoskr.run/linux-arch/2021/03/6302822/t.md

```text
On Thu, Mar 25, 2021 at 09:11:56PM +0000, Bae, Chang Seok wrote:
> But if sigaltstack()’ed with the SS_AUTODISARM flag, both on_sig_stack() and
> sas_ss_flags() return 0 [1]. Then, segfault always here. v5 had the exact
> issue before [2].

Ah, there's that SS_AUTODISARM check above it which I missed, sorry.

I guess we can do a __on_sig_stack() helper or so which does the stack
check only without the SS_AUTODISARM. Just for readability's sake in
what is already a pretty messy function.

Thx.

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
```
