Install the legacy out-of-tree Intel® SGX Linux* driver to benefit from (Intel® SGX) SGX2 instructions.
- Created an Intel® SGX application and used malloc to allocate memory
- Configured the HeapMinSize and HeapMaxSize in the enclave configuration file
- malloc returns nullptr after several allocations, before the memory allocation reaches HeapMaxSize
- Memory is not being allocated dynamically
Only the legacy out-of-tree (OOT) Intel® SGX Linux* driver supports (Intel® SGX) SGX2.
Execute these commands to check which Intel® SGX driver is installed:
ls /dev/*sgx* #Should return /dev/isgx
lsmod | grep -i sgx #Should return: isgx
If the return values are not as above then the OOT driver is not installed and you probably have the Data Center Attestation Primitives (DCAP). Uninstall the DCAP driver before installing the OOT driver.
- Uninstall the current driver
sudo /opt/intel/sgxdriver/uninstall.sh # The path to uninstall.sh may differ for your system.If the uninstall.sh script is missing, uninstall as follows:
sudo service aesmd stop
sudo rm -f $(find /lib/modules -name intel_sgx.ko)
sudo /sbin/depmod
sudo sed -i '/^intel_sgx$/d' /etc/modules
sudo rm -f /etc/sysconfig/modules/intel_sgx.modules
sudo rm -f /etc/modules-load.d/intel_sgx.conf
- Install the OOT driver using one of two methods
- Download and install the latest driver binary, similar to sgx_linux_x64_driver_2.11.054c9c4c.bin, from the Linux distribution folder
chmod 777 sgx_linux_x64_driver_2.11.054c9c4c.bin
sudo ./sgx_linux_x64_driver_2.11.054c9c4c.bin
- Build from source
- Download and install the latest driver binary, similar to sgx_linux_x64_driver_2.11.054c9c4c.bin, from the Linux distribution folder