mirror of
https://github.com/clearlinux/graphene.git
synced 2026-10-03 15:39:36 +00:00
[Pal/Linux-SGX] Set PAL_ERRNO to PAL_ERROR_INTERRUPTED when interrupted by host signal
Current Linux-SGX PAL signal handling unwinds all inner PAL frames if host signal interrupts Graphene while it waits on a long syscall. Because PAL frames are unwound, all inner logic of PAL setting PAL_ERRNO = PAL_ERROR_INTERRUPTED (using the _DkRaiseFailure() flow) is skipped. This commit retrofits this logic.
This commit is contained in:
@@ -410,6 +410,11 @@ void _DkHandleExternalEvent (PAL_NUM event, sgx_context_t * uc)
|
||||
arch_store_frame(&frame->arch);
|
||||
}
|
||||
|
||||
/* We only end up in _DkHandleExternalEvent() if interrupted during
|
||||
* host syscall; Dk* function will be unwound, so we must inform LibOS
|
||||
* layer that PAL was interrupted (by setting PAL_ERRNO). */
|
||||
_DkRaiseFailure(PAL_ERROR_INTERRUPTED);
|
||||
|
||||
if (!_DkGenericSignalHandle(event, 0, frame, NULL)
|
||||
&& event != PAL_EVENT_RESUME)
|
||||
_DkThreadExit();
|
||||
|
||||
Reference in New Issue
Block a user