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

Swap size of SGX between trusted and untrusted

double
Novice
393 Views

Hello,

When I use sgx, I need to transfer data from untrusted to trusted. But I found that when trusted reads the large data form untrusted, an error will occur, prompting: Segmentation fault (core dumped). I don't know if it's because there is a size limit to the buffer that passes data from the untrusted part to the trusted part? If yes, what is the size of the buffer? And what should I do to deal with the problem that transfer large data from untrusted to trusted? 

 

Sample:

I have a data in unstrusted, its size is 22MB. And I want to read the data to trusted. When I do this, I get an error message: Segmentation fault (core dumped). 

 

Thanks! 

Labels (1)
0 Kudos
1 Solution
KFPW_Intel
Moderator
307 Views

Hi,

 

Thank you for your interest in Intel® SGX.

 

Segmentation fault (Core dumped) could be due to there is not enough memory allocated to the enclave to pass a large array to an enclave via an ecall.

 

It is suggested to increase the amount of heap memory allocated to the enclave.

 

Refer to this Article while error: Segmentation Fault (Core Dumped) is encountered.

Refer to this Article to know how to copy all of the data in structures from the untrusted domain to the trusted domain of Intel® SGX enclaves.

 

Hope that these references are helpful.

 

Regards,

Ken


View solution in original post

3 Replies
KFPW_Intel
Moderator
308 Views

Hi,

 

Thank you for your interest in Intel® SGX.

 

Segmentation fault (Core dumped) could be due to there is not enough memory allocated to the enclave to pass a large array to an enclave via an ecall.

 

It is suggested to increase the amount of heap memory allocated to the enclave.

 

Refer to this Article while error: Segmentation Fault (Core Dumped) is encountered.

Refer to this Article to know how to copy all of the data in structures from the untrusted domain to the trusted domain of Intel® SGX enclaves.

 

Hope that these references are helpful.

 

Regards,

Ken


double
Novice
290 Views

Hi,

Thank you for your reply, I have found my problem. The HeapMaxSize in Enclave.config.xml has been set very large, but it did not work. After debugging, I found that my system HeapSize limited the maximum of HeapMaxSize of the enclave. So, I have set lager HeapSize of system, and it worked.

Thanks,

Double

KFPW_Intel
Moderator
283 Views

Hi,

 

Thank you for your question and the accepted solution. Hope the information provided is helpful. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.

 

Regards,

Ken


Reply