sgx-lkl
sgx-lkl copied to clipboard
SGX driver used by OpenEnclave is not supported by the latest Ubuntu 18.04 (kernel version 5.4.0)
The openenclave can not install the SGX driver since SGX driver 1.33 does not support Linux kernel that is lower than 5.4.0.
When building the SGX driver 1.33, the compiler will report errors like
/var/lib/dkms/sgx/1.33/build/encl.c: In function ‘sgx_encl_mm_release_deferred’:
./include/linux/kernel.h:994:51: error: ‘struct sgx_encl_mm’ has no member named ‘rcu’
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^
The default version of openclave used by sgx-lkl is at https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/DCAP_1.6/driver/linux/encl.c#L137
Intel updated the driver later, this function will only be compiled against Linux kernels that are below than 5.4.0. see at https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/DCAP_1.7/driver/linux/encl.c#L136
An easy way to work around is to update the source in the openenclave configuration file, see this commit https://github.com/openenclave/openenclave/commit/f3ba83aa8639d0bf96ae33b52ca9147f80361a9a