lucet icon indicating copy to clipboard operation
lucet copied to clipboard

Signal handlers leave behind unwound stack

Open acfoltzer opened this issue 4 years ago • 0 comments

If, when handling a signal, we are using either the default behavior (fault returning) or the terminating behavior, there is a context switch and execution continues back at the host. This means that the guest stack is left unwound, and so if any hostcalls in the call chain depend on unwinding to manage resources, we may leak resources.

This can arise from signals caused by hostcall code, or by guest code that is running as a callback from hostcall code. The former case is less of an issue, because if hostcall code is raising the types of signals we handle in Lucet, it is a buggy hostcall that needs to be fixed. However we don't have the same control over guest code, so we need to be very defensive about the latter case.

Perhaps we need to do manual unwinding?

acfoltzer avatar Jul 18 '19 00:07 acfoltzer