-
Notifications
You must be signed in to change notification settings - Fork 91
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
OE/mbedTLS related memory allocation problems #825
base: oe_port
Are you sure you want to change the base?
Conversation
If this is from the OE version of mbedTLS, it sounds like an upstream bug, can we fix it there to define mbed_malloc as oe_malloc and similar? |
That definition is in mbedTLS and there are lots of copies of |
Yeah, I think that's a viable solution, digging deeper. |
In the OE SDK, the mismatch is never a problem because oelibc forwards malloc to oe_malloc. But SGX-LKL replaces oelibc with its own version of libc in the kernel, which results in the mismatch. Perhaps we can make oe_malloc (and friends) weak in OE, and define our own versions of these that call equivalent functions in libc. |
@mikbras sure, that sounds like a good idea. I was able to work around my immediate problem with mbedTLS, but it would be great if we could get a more general solution to this. |
7bb947b
to
003e2b7
Compare
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
c67e3d8
to
28dc748
Compare
While trying to extract attestation evidence (the endorsements part to be precise) via
oe_get_evidence
, OE calls mbedTLS functions, which in turn callcalloc
and notoe_calloc
(here, wherembedtls_calloc == calloc
). This ends up calling sgx-lkl-musl'scalloc
, which ultimately complains that there's no memory because it hasn't been initialized yet. I had hoped this problem would go away after the user/kernel-space separation, but it's still there. I suspect that there could be a solution in just reordering the libraries on the command-line, but I haven't had any luck so far. What's the recommended solution for this type of problem?