- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried your code and I believe it returned an address outside the enclave. Could you try again?
I am using Intel SDK version 1.8, with gcc version 5.4.0 on a Ubuntu 16.04 system.
Wenhao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page