adombeck / python-sgx

Python interface to the SGX SDK
GNU General Public License v3.0
31 stars 6 forks source link

python-sgx is not compatible with your fork of sgx driver and graphene, could you update the fork of sgx driver and graohene? #2

Open TaihuLight opened 6 years ago

TaihuLight commented 6 years ago

Sorry, I test on Ubuntu 16.04.2, the current python-sgx is still not compatible with your fork of sgx driver and graphene, could you update the fork of sgx driver and graohene? The latest graphene contains the compatible sgx driver. I think that you can fork and patch a newer graphene and sgx driver for more DL developers to use your project! @adombeck Thank you very much!

I used your newly fored submodules, but python-sgx can not be built and installed successfully, the reasons illustrated as follows: (1)In graphene/Pal/src/host/Linux-SGX/sgx-driver/link-intel-driver.py of your forked graphene isgx = raw_input('Enter the Intel sgx driver derctory: ') if os.path.exists(isgx + '/isgx.h'): it should be if os.path.exists(isgx + '/sgx.h'): for your forked sgx driver (2)For /home/chengzi/Documents/python-sgx/graphene/Pal/src/host/Linux-SGX/sgx-driver/gsgx.h

include

include

include

delete "i" for head files as follows:

include

include

include

(3)In ./graphene/Pal/src/host/Linux-SGX/sgx-driver/isgx_ksyms.h //extern IMPORT_KSYM(isgx_enclave_release); //wrong extern IMPORT_KSYM(sgx_encl_release); //correct (4) ./graphene/Pal/src/host/Linux-SGX/sgx-driver/gsgx_main.c:202:and 220: error: ‘isgx_enclave_release’ undeclared here (not in a function) IMPORT_KSYM(isgx_enclave_release); //wrong IMPORT_KSYM(sgx_encl_release); //correct //if ((ret = LOOKUP_KSYM(isgx_enclave_release))) //wrong if ((ret = LOOKUP_KSYM(sgx_encl_release))) //correct (5)The error is occured when run sudo ./load.sh Enter the Intel sgx driver derctory: /home/chengzi/Documents/python-sgx/linux-sgx-driver linux-sgx-driver -> /home/chengzi/Documents/python-sgx/linux-sgx-driver make -C /lib/modules/4.10.0-42-generic/build SUBDIRS=/home/chengzi/Documents/python-sgx/graphene/Pal/src/host/Linux-SGX/sgx-driver CFLAGS_MODULE="-DDEBUG -g -O0" modules make[1]: Entering directory '/usr/src/linux-headers-4.10.0-42-generic' Building modules, stage 2. MODPOST 1 modules make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-42-generic' insmod: ERROR: could not insert module graphene-sgx.ko: Invalid parameters

(6) FATAL: when run ./python.manifest.sgx scripts/helloworld.py , and CPU 100% ./python.manifest.sgx scripts/helloworld.py manifest file: file:python.manifest.sgx enclave created: base: 0x0000000000000000 size: 0x0000000010000000 attr: 0x0000000000000007 xfrm: 0x0000000000000007 ssaframesize: 1 isvprodid: 0x00000000 isvsvn: 0x00000000 adding page to enclave: 000000000ffff000 [REG:R--] (manifest) measured adding pages to enclave: 000000000fff6000-000000000fffe000 [REG:RW-] (ssa) adding pages to enclave: 000000000fff1000-000000000fff5000 [TCS:---] (tcs) adding pages to enclave: 000000000ffec000-000000000fff0000 [REG:RW-] (tls) adding pages to enclave: 000000000ffdb000-000000000ffeb000 [REG:RW-] (stack) adding pages to enclave: 000000000ffca000-000000000ffda000 [REG:RW-] (stack) adding pages to enclave: 000000000ffb9000-000000000ffc9000 [REG:RW-] (stack) adding pages to enclave: 000000000ffa8000-000000000ffb8000 [REG:RW-] (stack) adding pages to enclave: 000000000bd76000-000000000bda4000 [REG:R-X] (code) measured adding page to enclave: 000000000bfa4000 [REG:RW-] (data) measured adding pages to enclave: 000000000bfa5000-000000000ffa7000 [REG:RW-] (bss) adding pages to enclave: 0000000000400000-00000000006e9000 [REG:RWX] (code) measured adding pages to enclave: 00000000008e8000-0000000000961000 [REG:RW-] (data) measured adding pages to enclave: 0000000000961000-0000000000984000 [REG:RW-] (bss) adding pages to enclave: 0000000000984000-000000000bd75000 [REG:RWX] (free) adding pages to enclave: 0000000000010000-0000000000400000 [REG:RWX] (free) enclave initializing: enclave id: 0x000000000ffff000 enclave hash: 3a 24 14 cd 9f 77 2f 78 f4 6b 70 a0 a2 b2 66 ca 3f 8e 21 ce e5 32 05 8a 4b e4 1d f6 18 e3 a5 90 Get sealing key: e72f44bc654bd7d4161fe920639cce5 enclave (software) key hash: b4bbec653d49ce4b0cc48c45198807ff7f0a31ea279359f673e1ed9836f487f trusted: [1] 2cdf459db6d2a82d87fd8f65cb28547bfe752d6763f6a91a52158feebb4573a7 file:/usr/bin/python trusted: [2] a6048640494d327383021ff1b6527d8fd213e2a010e7094aad686bced1943f09 file:../../../../../Runtime/libsysdb.so trusted: [16] e5448a9de1c4675ceb16278bcb46fbd6b0f797636096c144ac97c897a104dedd file:hosts trusted: [17] 7e8ad76e0d200e93918ca2e93c99ff8ecd02071953bf1479819db3ac0dbb6d07 file:resolv.conf trusted: [18] 76a5771adee7b9f36c7ae66eae78d72f325557500269107f2d98a7e3560a1808 file:gai.conf allowed: file:/usr/lib/python2.7 allowed: file:scripts

TaihuLight commented 6 years ago

So python-sgx can not be built and installed successfully, I hope you can fix the problem in the project, and the latest graphene contains the compatible sgx driver. I think that you can fork and patch a newer graphene and sgx driver for more DL developers to use your project! @adombeck Thank you very much!

liurenju commented 6 years ago

Same issue. i also manually updated the kernel driver and the sdk, but it didn't work

Khallu commented 4 years ago

@TaihuLight were you able to run it after making the changes?