Skip to content
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

Support build time setting of enclave load directory #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

berrange
Copy link

The current code for loading enclaves (pce, id_enclave, qe3, tdqe, qve) tries to find the enclave file in the directory of the currently loaded library (as reported by dladdr), or in the directory of the current executable (as reported by /proc/self/exe).

Neither of these approaches is sufficiently flexible to work with all Linux distro filesystem layout policies. In particular distros may desire to have a specific directory location exclusively for the shipping of enclaves, separate from any native libraries or executables.

This introduces support for an "SGX_ENCLAVE_PATH" variable in the makefiles, which is used to define an SGX_ENCLAVE_PATH symbol in code.

By default SGX_ENCLAVE_PATH path will get defined to an empty string at the C level and so current code behaviour will not be changed.

If this is set though, then it will be used to locate the enclaves, with no fallback to searching relative to the library or binary.

The current code for loading enclaves (pce, id_enclave, qe3, tdqe, qve)
tries to find the enclave file in the directory of the currently
loaded library (as reported by dladdr), or in the directory of the
current executable (as reported by /proc/self/exe).

Neither of these approaches is sufficiently flexible to work with
all Linux distro filesystem layout policies. In particular distros
may desire to have a specific directory location exclusively for
the shipping of enclaves, separate from any native libraries or
executables.

This introduces support for an "SGX_ENCLAVE_PATH" variable in the
makefiles, which is used to define an SGX_ENCLAVE_PATH symbol in
code.

By default SGX_ENCLAVE_PATH path will get defined to an empty
string at the C level and so current code behaviour will not
be changed.

If this is set though, then it will be used to locate the enclaves,
with no fallback to searching relative to the library or binary.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant