intel/kvm-sgx

SGXSGIN returns "Invalid blob size"

mbailleu opened this issue · 8 comments

I am trying to compile the kernel. However, the compilation fails at the signing process:

  SGXSIGN drivers/platform/x86/intel_sgx/le/enclave/sgx_le.ss
Invalid blob size 38064 

The signing utility is complaining that the size of the launch enclave is not a multiple of 4k. Beyond that I can't provide much help as I'm not intimately familiar with the LE build flow. Have you tried cleaning and rebuilding?

@jsakkine-intel Have you seen this issue before?

As a workaround, if it still fails after a rebuild, you can disable the userspace SGX driver, i.e. CONFIG_INTEL_SGX=n. The userspace driver is not needed for KVM SGX support.

I got it build now, thanks.
The error occurs if you have set:

CONFIG_TRACE_BRANCH_PROFILING=y
CONFIG_PROFILE_ALL_BRANCHES=y

Maybe you could add it to the INTEL_SGX dependence.

Do you build with CONFIG_RETPOLINE? It is not yet supported. That could potentially cause issues.

Can you submit the exact .config where this failure occurs?

config.gz
However, to reproduce the error I had to do a clone of the repo, as the error did not reappear after a make clean

I'm sorry. I missed your earlier comment about the config options. I'll try to reproduce this error locally. Thank you.

Tried with https://github.com/jsakkine-intel/linux-sgx. Does not reproduce. Could be that the issue was fixed in subsequential patch set after v5. Which branch I should test from https://github.com/sean-jc/linux.git?

Closing this issue as the latest release does not contain an in-kernel launch enclave, i.e. the code in question no longer exists.