Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

EREPORT returns a Segmentation fault

Shredha_K_
Novice
354 Views

Hi all,

I was trying to execute the EREPORT instruction using inline assembly. I intend to give a NULL value to RBX and RCX (as sgx_target_info_t and sgx_report_data_t can be NULL). RDX contains the address where the REPORT will  be written. The following is my  code snippet. 

sgx_report_t report;
unsigned long *addr = &report;

asm("xor %rbx,%rbx");

asm("xor %rcx,%rcx");

asm volatile("mov %0,%%rdx": :"r" (addr) );

asm("xor %eax,%eax");

asm("enclu");

 

Please tell me where I am getting wrong. Thanks in advance. 

 

 

0 Kudos
1 Reply
Anusha_K_Intel
Employee
354 Views

Hi,

There is some error in your inline assembly language code.Can you please specify at what point you are receiving the segmentation fault and does asm command work in your enclave code since it suggests to use _asm and you cannot directly assign &report to unsigned long .

 

 

 

Reply