adombeck / python-sgx Goto Github PK
View Code? Open in Web Editor NEWPython interface to the SGX SDK
License: GNU General Public License v3.0
Python interface to the SGX SDK
License: GNU General Public License v3.0
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 <isgx.h>
#include <isgx_arch.h>
#include <isgx_user.h>
delete "i" for head files as follows:
#include <sgx.h>
#include <sgx_arch.h>
#include <sgx_user.h>
(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
Hi,
After I compiled and did everything I tried running the sgx-ra-manager
and it seems like it only runs the manifest and not the python file itself.
I opened an issue in graphene: gramineproject/graphene#203
If anyone here can help, I'll be glad :)
Due to graphene @ 60925a8 is cannot got, and the latest version of graphene in your repo is not suitable for python-sgx, because the sgx-driver in python-sgx uses sgx.h instead of isgx.h, but graphene in your repo needs the old isgx.h and son on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.