Hi,I'm Shohei.I'm studying intel SGX in Japan.
I tried to get untrusted-stack information from enclave, but I couldn't do it.
When EENTER is called, where is saved register information in untrusted world. Is saved in Enclave?
Thank you
Shohei
The enclaves and the outside have different stacks. On EENTER, the outside stack pointer RSP, RBP are saved in the state save area (SSA) frame of the current thread's TCS, for later restore on AEX. It is saved in the GPRSGX region of SSA frame. Here is the reference manual: https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf Sec. 2.9.1, Table 2-8.
Wenhao
連結已複製
The enclaves and the outside have different stacks. On EENTER, the outside stack pointer RSP, RBP are saved in the state save area (SSA) frame of the current thread's TCS, for later restore on AEX. It is saved in the GPRSGX region of SSA frame. Here is the reference manual: https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf Sec. 2.9.1, Table 2-8.
Wenhao
Thank you for your answer. That information is good for me.
But I have another question. When I tried, I call GPRSGX region of SSA frame from enclave.Here is that code.
_thread_data_t *thread_data; thread_data = get_thread_data(); ssa_gpr_t *ssa_gpr = reinterpret_cast<ssa_gpr_t *>(thread_data->first_ssa_gpr); unsigned long addbp = ssa_gpr->REG(bp_u);
But addbp points enclave's stack ebp not uEBP. Where do you think there were mistakes?
Thank you
Shohei
Thanks
That address is outside Enclave stack address? My code returns enclave stack ebp.
I tried this code in /Samplecode/SampleEnclave/Enclave/Trustedlibrary/Libc.cpp on SDK.
So I will check address outside the enclave again, and SDK, gcc, Ubuntu version.
Thanks a lot!
Shohei