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

Swap size of SGX between trusted and untrusted

double
Novice
771 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
685 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

0 Kudos
3 Replies
KFPW_Intel
Moderator
686 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


0 Kudos
double
Novice
668 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

0 Kudos
KFPW_Intel
Moderator
661 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


0 Kudos
Reply