Re: mprotect PROT_SIGNAL

From
Florian Weimer <hidden>
Date
2024-07-16 15:13:34
Reply to
Soni "They/Them" L., 2024-07-09
* Soni L.:
we'd like an mprotect PROT_SIGNAL flag for a compiler we're making

PROT_SIGNAL - marks the pages as unmapped while running signal handlers

this would be very useful, do you think you could provide it?

(not much more to say about it, it's supposed to do what it says on
the tin, we want to unmap pages in signal handlers so as to catch bugs
without causing memory corruption.)
The challenge is going to be to detect abnormal exit from the signal
handler.

You can already get some of this behavior to today with memory
protection keys, on x86-64 at least.  (I consider this a glitch in the
implementation, it makes it less useful.)  Access is revoked
automatically when the hander is invoked.  However, access is not
restored if you jump out of the handler using longjmp or by throwing an
exception.

Thanks,
Florian
Thread (3 messages) 3 messages, 2 authors, last reply 2024-07-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help