intel / intel/confidential-computing.sgx

Failed to load enclave in ubuntu 18.04.5

Open
#623 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.5k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

I compiled the sample code SampleCode/LocalAttestation in hardware mode and ran it with error listed below(it runs ok when compiled in SIMULATION mode).

OS version:4.15.0-122-generic #124-Ubuntu SMP Thu Oct 15 13:03:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

the make result is listed below:
@@@@@@@@@@@@ make result @@@@@@@@@@@@@
0
0
0x40000
0x100000
1
1
0

[build_secs /home/sgx/linux-sgx/psw/urts/loader.cpp:517] Enclave start addr. = (nil), Size = 0x400000, 4096 KB
SIGN => libenclave_initiator.signed.so
make[1]: leave“/home/sgx/linux-sgx/SampleCode/LocalAttestation/EnclaveInitiator”
make[1]: enter“/home/sgx/linux-sgx/SampleCode/LocalAttestation/EnclaveResponder”
GEN => EnclaveResponder_t.h
CC <= EnclaveResponder_t.c
[build_secs /home/sgx/linux-sgx/psw/urts/loader.cpp:517] Enclave start addr. = (nil), Size = 0x400000, 4096 KB
SIGN => libenclave_responder.signed.so
make[1]: leave dirctory“/home/sgx/linux-sgx/SampleCode/LocalAttestation/EnclaveResponder”
make[1]: enter“/home/sgx/linux-sgx/SampleCode/LocalAttestation/App”
CC <= EnclaveInitiator_u.c
CC <= EnclaveResponder_u.c
CXX <= App.cpp
SGX_INC is -I/opt/intel/sgxsdk//include
LIB is -lsgx_urts -lsgx_uae_service -L/opt/intel/sgxsdk//lib64 -lpthread
CC <= UntrustedEnclaveMessageExchange.cpp
GEN => app
make[1]: leave “/home/sgx/linux-sgx/SampleCode/LocalAttestation/App”
The project has been built in hardware debug mode.

@@@@@@@@@@@@@run error@@@@@@@@@@@@@
sgx@scott-Server-Platform:~/linux-sgx/SampleCode/LocalAttestation$ bin/app:

[CEnclavePool /home/sgx/linux-sgx/psw/urts/enclave.cpp:629] enter CEnclavePool constructor
[__sgx_create_enclave_ex urts.cpp:91] Couldn't open the enclave file, error = 2
failed to load enclave.
[remove_enclave /home/sgx/linux-sgx/psw/urts/enclave.cpp:783] remove an unknown enclave
[remove_enclave /home/sgx/linux-sgx/psw/urts/enclave.cpp:783] remove an unknown enclave
sgx@scott-Server-Platform:~/linux-sgx/SampleCode/LocalAttestation$

@@@@@@@@@@@@@ library info@@@@@@@@@@@@@@
sgx@scott-Server-Platform:~/linux-sgx/SampleCode/LocalAttestation$ ldd bin/app
linux-vdso.so.1 (0x00007fff6b188000)
libsgx_urts.so => /usr/lib/x86_64-linux-gnu/libsgx_urts.so (0x00007fae6c9db000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fae6c42c000)
libsgx_enclave_common.so.1 => /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1 (0x00007fae6c9c5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fae6c20d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fae6c009000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fae6bc80000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fae6ba68000)
/lib64/ld-linux-x86-64.so.2 (0x00007fae6c81d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fae6b6ca000)
sgx@scott-Server-Platform:~/linux-sgx/SampleCode/LocalAttestation$

@@@@@@@@@@@@@ ldconfig info@@@@@@@@@@@@@@
sgx@scott-Server-Platform:~/linux-sgx/SampleCode/LocalAttestation$ sudo ldconfig -v |grep sgx
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.27.so is the dynamic linker, ignoring

libsgx_dcap_quoteverify.so.1 -> libsgx_dcap_quoteverify.so.1.8.100.2
libsgx_dcap_ql.so.1 -> libsgx_dcap_ql.so.1.8.100.2
libsgx_launch.so.1 -> libsgx_launch.so.1.0.107.2
libsgx_pce_logic.so -> libsgx_pce_logic.so
libsgx_epid.so.1 -> libsgx_epid.so.1.0.107.2
libsgx_pce.signed.so -> libsgx_pce.signed.so
libsgx_quote_ex.so.1 -> libsgx_quote_ex.so.1.1.107.2
libsgx_qe3.signed.so -> libsgx_qe3.signed.so
libsgx_qve.signed.so -> libsgx_qve.signed.so
libsgx_enclave_common.so.1 -> libsgx_enclave_common.so.1.0.112.2
libsgx_qe3_logic.so -> libsgx_qe3_logic.so
libsgx_urts.so -> libsgx_urts.so.1.1.109.2
/sbin/ldconfig.real: /lib32/ld-2.27.so is the dynamic linker, ignoring

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the hardware-mode run from SampleCode/LocalAttestation with bin/app, then inspect the referenced URTS paths psw/urts/enclave.cpp:629 and loader.cpp:517. Compare the generated enclave files and runtime output with the simulation-mode build. Done means identifying why the enclave file cannot be opened and confirming that the sample loads successfully in hardware mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, ubuntu
Domain
operating-systems, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.