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

Ensure that oe_enclave_properties_sgx doesn't use GOT in globals.c #4473

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

Conversation

anakrish
Copy link
Contributor

This allows oe_enclave_properties_sgx to be used even before
relocations have been done, just like _enclave_rva, _reloc_rva etc.
Thus core api oe_is_within_enclave, oe_is_outside_enclave can be used
anywhere in enclave code, even before relocations.

To ensure that no GOT is used, a weak definition of oe_enclave_properties is defined in
globals.c. This definition willl be put in .oeinfo section.
If an enclave uses the OE_SET_ENCLAVE_SGX macro, then a strong definition will be emitted
which will override the weak definition.

Signed-off-by: Anand Krishnamoorthi anakrish@microsoft.com

This allows oe_enclave_properties_sgx to be used even before
relocations have been done, just like _enclave_rva, _reloc_rva etc.
Thus core api oe_is_within_enclave, oe_is_outside_enclave can be used
anywhere in enclave code, even before relocations.

To ensure that no GOT is used, a weak definition of oe_enclave_properties is defined in
globals.c. This definition willl be put in .oeinfo section.
If an enclave uses the OE_SET_ENCLAVE_SGX macro, then a strong definition will be emitted
which will override the weak definition.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
@anakrish
Copy link
Contributor Author

bors try

@anakrish anakrish added the do not merge Indicates a PR should not be merged until removed. label Apr 21, 2022
bors bot pushed a commit that referenced this pull request Apr 22, 2022
@bors
Copy link

bors bot commented Apr 22, 2022

try

Build succeeded:

@anakrish
Copy link
Contributor Author

bors try

bors bot pushed a commit that referenced this pull request Apr 26, 2022
@bors
Copy link

bors bot commented Apr 27, 2022

try

Build failed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Indicates a PR should not be merged until removed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants