Skip to content

Signal handler#85

Open
w-woloszyn wants to merge 4 commits into
jovanbulck:masterfrom
w-woloszyn:pf
Open

Signal handler#85
w-woloszyn wants to merge 4 commits into
jovanbulck:masterfrom
w-woloszyn:pf

Conversation

@w-woloszyn

Copy link
Copy Markdown
Contributor

This is step [1/n] for abstracting out the signal handler (including page fault handler).
[2/n] is to take out sigsegv handler from apps to the library as the default.

Question before I push [2/n]:
Should fault counters be held within the library or in the app?

- Introduce signal handler into libsgxstep
- Refactor app/memcmp/main.c to use the library handler
@jovanbulck

Copy link
Copy Markdown
Owner

Thanks Wojciech, this is great! Linking #52

[2/n] is to take out sigsegv handler from apps to the library as the default.

That would indeed cleanup a lot, so let's merge this as one series.

Should fault counters be held within the library or in the app?

As this is likely something that many apps will use, I'd be in favor of putting this in the lib indeed, similar to some existing irq counters (eg sgx_step_eresume_cnt in aep_trampoline.S).


One further consideration, I think signal handlers won't work anymore for more recent kernels with VDSO for /dev/sgx_enclave. This is atm not really a problem cause we have to pass novdso anyway, but at some point I'd like to properly get rid of that (cf #28 to intercept EENTER/ERESUME without needing to patch the SDK).

https://github.com/intel/linux-sgx/blob/c1ceb4fe146e0feb1097dee81c7e89925443e43c/psw/urts/linux/sig_handler.cpp#L444

This whole approach of registering signal handlers was always a big hack.. The SDK also registers its own signal handler and we overwrite that w sgx-step, which is prob fine as long as the enclave does not rely on signal handlers itself..

I think the work you started here to have an abstract libsgxstep interface that applications then use will allow to update this transparently on the longer term eg when using vdso to enter the enclave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants