-
Notifications
You must be signed in to change notification settings - Fork 203
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
SGX loader is not statically linked #1261
Comments
By tools, we meant shared libraries that can be used inside Gramine (for better/smaller TCB inside SGX enclave).
That's right. This is because of the dependency on Why is that a problem? Could you suggest a solution? UPDATE: Actually, looks like we could statically link |
Is this needed for non-EPID? IIRC this launch sequence got changed after we dropped the |
We always need to get the SGX Quote, no matter EPID or DCAP attestation. And the SGX Quote is generated by the Quoting Enclave (QE), with which Gramine needs to communicate (send the request "Please produce the SGX quote for this enclave" and receive the Quote back). For this communication with QE, we use AESM daemon. There is another way, IIRC, but it's linking against some QE-wrapping shared library or something like this, which has its own problems. |
So a quick experiment gives me this:
So the SGX loader is still using environment variables, asserts, malloc/free and even realpath from Glibc. I think these all could be gotten rid of, though I still don't see what would be the reason for this? |
I was hoping to be able to run Gramine without depending on any of the distro specific libraries. |
Not even on Glibc? |
The result after
is not quite enough but I now realize my original ask may have issues. Let me think about it. |
Beware what you're hoping for. If we really linked everything statically, then if there's a security vulnerability in any of our dependencies, the only option for us is to do a release, probably incompatible one (for example, 1.5 will be a breaking change because of #1256). Static linking increases amount of breakage in the ecosystem. If they're dynamically linked, then you can just update the dependency and leave Gramine alone. |
That's a valid comment. Making this a configure/build time option for users would probably work for starters (it's different from what I originally reporter but I can update the issue description). Do you see any blockers with this approach? |
Do you see any blockers with this approach?
Testing. We're not equipped to test all the configurations (cartesian product
of all the options' values), so inevitably we'll get into position where one
of two configurations are tested in CI and for the rest of them we'll assume
that just adding `, static: true` somewhere in meson.build should work and we
won't test it.
|
It turns out this is a much more serious issue than we thought - glibc silently assumes that all the threads created in a process were spawned using Random notes:
Possible solutions:
See also:
|
Is this issue being worked on? CC @mkow |
Yes, we plan to have it for the next release (in ~2 months), but may land it on |
Description of the problem
v1.4 release notes noted that all SGX tools are now statically linked but looks like
loader
is not.---- note by @mkow ---
This turned out to be a serious issue, see my comment below: #1261 (comment).
----
Steps to reproduce
Expected results
/usr/lib/x86_64-linux-gnu/gramine/sgx/loader
to be statically linkedActual results
No response
Gramine commit hash
988e6b8
The text was updated successfully, but these errors were encountered: