Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

EREPORT returns a Segmentation fault

Shredha_K_
Novice
527 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
527 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 .

 

 

 

0 Kudos
Reply