-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: abstract SDK interface for libsgxstep
#28
Comments
some relevant notes on moving fwd here; currently we rely on the following patches (which can probably be further reduced as outlined):
TODO: look into how to best support Note: Linux VDSO system sets the AEP here |
idea to look into: maybe we can simply replace all |
Proper integration of SGX-Step with different runtimes is still an outstanding issue (#28). Currently, only the Intel SDK is "officially" supported. An (untested) stub to start on integration with Gramine is, furthermore, provided "as is" in the `gramine` directory.
Trap any ENCLU occurences in shared libraries before loading using LD_LIBRARY_PATH and redirect them transparently to SGX-Step at runtime (cf. issue #28). This should allow to get rid of the custom patched SDK dependency and make SGX-Step inherently SDK-agnostic. In principle, SGX-Step could in this way also attached as a LD_PRELOAD shared library to a precompiled SGX application (eg in case of a libOS like Gramine).
this is now PoC implemented in the commit above remaining TODOs:
|
This may be easy as the VDSO text region seems to be mapped as copy-on-write: https://elixir.bootlin.com/linux/v6.10.10/source/arch/x86/entry/vdso/vma.c#L243 |
hot-patching VDSO to redirect ENCLU seems to work: This would allow SGX-Step to run without any binary patches on recent SDKs 🎉 Needs cleanup and testing before merging, but binary patching + vdso patching both should work now and the cumbersome SDK source patching dependency can hopefully be dropped.. |
Ideally
libsgxstep
should be less tightly coupled to the Intel SGX-SDK and rely on a clean and stable interface that can be easily ported to other SDKs or libOSs, eg at least the following:EENTER
to allow for custom AEP stub for single-steppinglibsgxstep
to other SDKsAt least the user-space SDK components should be easily pluggable. Integration with the kernel space
isgx
driver may be more tight, but that should be less of an issue as most SDKs rely on theisgx
driver anyway..The text was updated successfully, but these errors were encountered: