-
Notifications
You must be signed in to change notification settings - Fork 80
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
Syscall emulation #31
Comments
The state saving is done in qemu-level, not in user-level (libsgx). |
So you're saying EEXIT both saves sate and increases CSSA? Because neither of those things are compatible with the spec. How do you do a regular EEXIT? |
Both of them are performed in our trampoline design, which is a customized feature we add. If you only want to use EEXIT in normal way (e.g., terminates enclave) then it follows the spec. |
Looking at the code linked above it looks like you always save state and increase CSSA, unless RBX=0, which would almost assuredly result in an exception for trying to access address 0. This means I can never re-enter an enclave with NSSA=1 after EEXIT? |
While reading your NDSS paper on OpenSGX, a question arised regarding syscall emulation. I e-mailed with Prerit (first author in lieu of a specified corresponding author) and he suggested I bring this up here.
In §IV-B "System call emulation" you write that the enclave context is saved. In §IV-D "Trampoline and stub" you write that the enclave is exited using EEXIT and then entered using ERESUME. I looked at your libsgx source code and it does not seem that any state is saved before calling EEXIT, nor does EEXIT save state. Furthermore, EEXIT does not increase TCS.CSSA, while ERESUME decreases TCS.CSSA. If I interpret the SGX reference correctly, ERESUME is only to be called after an asynchronous exit.
Prerit pointed me at the following code: https://github.com/sslab-gatech/opensgx/blob/407d176/qemu/target-i386/sgx_helper.c#L2041 but I don't think it matches the SGX programming reference. You mention multiple times in the paper that OpenSGX is instruction-compatible. Can you elaborate on this?
The text was updated successfully, but these errors were encountered: