Support build time setting of enclave load directory#437
Open
berrange wants to merge 1 commit intointel:mainfrom
Open
Support build time setting of enclave load directory#437berrange wants to merge 1 commit intointel:mainfrom
berrange wants to merge 1 commit intointel:mainfrom
Conversation
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é <berrange@redhat.com>
62d53b6 to
ddf70da
Compare
Contributor
Author
|
Rebased to resolve conflicts with latest git main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bydladdr), 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 anSGX_ENCLAVE_PATHsymbol in code.By default
SGX_ENCLAVE_PATHpath 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.