Thread (16 messages) 16 messages, 4 authors, 2021-05-18

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

From: Bae, Chang Seok <hidden>
Date: 2021-05-12 20:13:03
Also in: linux-arch, lkml

On May 11, 2021, at 11:36, Borislav Petkov [off-list ref] wrote:
I clumsily tried to register a SIGSEGV handler with

       act.sa_sigaction = my_sigsegv;
       sigaction(SIGSEGV, &act, NULL);

but that doesn't fire - task gets killed. Maybe I'm doing it wrong.
Since the altstack is already overflowed, perhaps set the flag like this -- not
using it to get the handler:

	act.sa_sigaction = my_sigsegv;
+	act.sa_flags = SA_SIGINFO;
	sigaction(SIGSEGV, &act, NULL);

FWIW, I think this is just a workaround for this case; in practice, altstack is
rather a backup for normal stack corruption.

Thanks,
Chang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help