-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of --config=sgx-sim or enc-sim still supported on Asylo 0.6? #62
Comments
The config option is not necessary in most common cases now. The new build
concepts are discussed here
https://asylo.dev/docs/concepts/building.html
The config we used in the past changes the top level toolchain to the
enclave toolchain, which will not normally work for the untrusted
application part of the build. Before Bazel added the configuration
transitions feature, we had to finagle the build system to bend over
backwards to build the untrusted application with the appropriate toolchain
(copy_from_host).
I designed this new configuration, so if anything is unclear, please let me
know and I’ll clarify in our documentation.
…-Dionna
On Sun, Dec 13, 2020 at 14:42 asmprogrammer5 ***@***.***> wrote:
I'm trying to compile hello_world on an Ubuntu 18.04 with the manual
installation instructions provided in INSTALL.md. Is the config option
still supported? I keep getting an error while compiling sgx_sdk. The only
option to compile hello_world that works for me is if I remove
--config=sgx-sim and use //asylo/examples/hello_world:hello_world_sgx_sim.
Question is whether --config=sgx-sim or --config=enc-sim still supported?
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c: In function
'se_mutex_init':
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c:67:2: error:
#error no pre-defined RECURSIVE_MUTEX found. #error no pre-defined
RECURSIVE_MUTEX found. ^~~~~
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c:71:20: error:
'tmp' undeclared (first use in this function); did you mean 'tm'?
memcpy(mutex, &tmp, sizeof(tmp)); ^~~ tm
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c:71:20: note: each
undeclared identifier is reported only once for each function it appears in
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c: In function
'se_get_threadid':
external/sgx_dcap/QuoteGeneration/common/src/se_thread.c:89:63: error:
'__NR_gettid' undeclared (first use in this function); did you mean
'SYS_gettid'? unsigned int se_get_threadid(void) { return
(unsigned)syscall(__NR_gettid);} ^~~~~~~~~~~ SYS_gettid Target
//asylo/examples/hello_world:hello_world_sgx_sim failed to build
or another run:
`Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
external/linux_sgx/common/src/se_event.c:35:10: fatal error:
linux/futex.h: No such file or directory
#include <linux/futex.h>
^~~~~~~~~~~~~~~
`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#62>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL4HDBLYVJUTDDXNMPGNTSUU7ODANCNFSM4UZ3CYWQ>
.
|
Thanks, couple of follow ups:
#include <linux/types.h> I am getting an error when I added some trial code in primitives/sgx/<file.cc>
Using external/com_google_asylo_toolchain/toolchain/bin/x86_64-elf-gcc. What is needed to include host usr/include files in this new backend model? |
The Asylo enclave runtime environment does not provide a complete set of Linux APIs, so you will not be able to include all Linux system headers. We’ve added a few Linux extensions to our POSIX environment to allow for some performance improvements and added compatibility. The goal of Asylo is to be small and trustworthy, but still useful. Full Linux compatibility is an anti-goal of Asylo. If you need simple typedefs or macros, our suggestion is to copy the file into your project and depend on it explicitly. |
Thanks, I get the point regarding the Asylo's need to be hermetic. Ok using -isystem can let me include some of these system headers. For the backend flag, yes, I meant --config=sgx-sim that leads to SGX_SIM=1 value. But going back to the Asylo's small and trustworthy goal, we still need the Intel's SGX SDK, that includes many of the system header files right? Is that ok or is there a plan to change that? |
Asylo uses a small subset of the Intel SDK for creating the enclave
execution context and some ecall/ocall handling. I wouldn’t say either
Asylo or Intel SGX SDK use many linux system headers for building enclaves
because we both have self-contained trusted runtimes. Including a header
for type declarations is something we’ll do, and in some cases we’ll define
declared symbols as immediate aborts just to be compatible at linking time.
We do thorough testing to ensure execution paths we need do not end up
calling the stubbed functions.
The include paths and headers we provide are meant to ease porting efforts.
Do you have pointers to headers we use or Intel SGX SDK uses transitively
that are cause for concern?
…On Thu, Dec 17, 2020 at 11:44 asmprogrammer5 ***@***.***> wrote:
Thanks, I get the point regarding the Asylo's need to be hermetic. Ok
using -isystem can let me include some of these system headers.
For the backend flag, yes, I meant --config=sgx-sim that leads to
SGX_SIM=1 value.
But going back to the Asylo's small and trustworthy goal, we still need
the Intel's SGX SDK, that includes many of the system header files right?
Is that ok or is there a plan to change that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL4HEQK6YP7FXGWDECX63SVJNRTANCNFSM4UZ3CYWQ>
.
|
I guess we need to differentiate between what is part of the enclave runtime and what is built for the untrusted part. I'm looking at a few headers in linux_sgx/common/inc/internal Not as much as a concern, but I wanted to ensure that my code is inline with what Asylo and the SGX SDK was designed for and not changing the security context. |
I recommend reading our runtime documentation since there are some syscalls
that will compile and link but fail due to unsupported flags for instance.
…On Thu, Dec 17, 2020 at 13:31 asmprogrammer5 ***@***.***> wrote:
I guess we need to differentiate between what is part of the enclave
runtime and what is built for the untrusted part. I'm looking at a few
headers in linux_sgx/common/inc/internal
Not as much as a concern, but I wanted to ensure that my code is inline
with what Asylo and the SGX SDK was designed for and not changing the
security context.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL4HCZ7CM64UAJWKS44B3SVJ2ETANCNFSM4UZ3CYWQ>
.
|
I'm trying to compile hello_world on an Ubuntu 18.04 with the manual installation instructions provided in INSTALL.md. Is the config option still supported? I keep getting an error while compiling sgx_sdk. The only option to compile hello_world that works for me is if I remove --config=sgx-sim and use //asylo/examples/hello_world:hello_world_sgx_sim.
Question is whether --config=sgx-sim or --config=enc-sim still supported?
or another run:
The difference between --config=sgx-sim and _sgx_sim seems to be in the compiler/toolchain used:
--config=sgx-sim (fails)
_sgx_sim (without --config options, succeeds)
The text was updated successfully, but these errors were encountered: