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

Incomplete/unsafe signal handling with SGX1 #680

Open
3 tasks
prp opened this issue Jul 27, 2020 · 0 comments
Open
3 tasks

Incomplete/unsafe signal handling with SGX1 #680

prp opened this issue Jul 27, 2020 · 0 comments
Labels
area: compatibility Compatibility of existing workloads/apps area: sgx-lkl Core SGX-LKL functionality enhancement p1 Medium priority
Milestone

Comments

@prp
Copy link
Member

prp commented Jul 27, 2020

Background

With SGX1 enclaves, it is not possible to obtain information inside the enclave about #PF and #GP exceptions.

The current behaviour of OE is therefore to not deliver #PF and #GP exceptions to the enclave. This causes problems for applications running with SGX-LKL that need to register signal handlers for SIGSEGV to work correctly, e.g. the OpenJDK JVM.

Therefore the SGX-LKL OE branch contains a workaround that delivers #PF exceptions to the enclave, even though these exceptions cannot be validated by the enclave. Since this is an attack vector, SGX-LKL now has an enclave_config parameter unsafe_host_signals, which controls if this behaviour is permitted.

Open issues

  • Currently, unsafe_host_signals has a default value of true, as otherwise all Java CI tests and tests that require SIGSEGV to be handled are broken. Due to its security implications, the default for unsafe_host_signals should be false.

  • The current support for SIGSEGVs with unsafe_host_signals exposes the signal to the enclave but it does not relay the address that caused the page fault to the enclave. This results in unstable JVM execution (see Some Java DaCapo benchmarks fail with unhandled SIGSEGVs in hw mode #645). It is not clear if there is a way of obtaining the faulting address with SGX1.

  • The OE patch for #PF exception support in the feature/sgx-lkl-support branch of OE is a workaround that cannot be upstreamed to master. It should be redesigned to find a more permanent solution for SGX1 exception handling.

(cc: @mikbras @davidchisnall @letmaik @paulcallen)

The first of these is p1, once this is done the remainder should be marked as p2.

@prp prp added enhancement area: sgx-lkl Core SGX-LKL functionality p1 Medium priority area: compatibility Compatibility of existing workloads/apps labels Jul 27, 2020
@prp prp added this to the Milestone 1 milestone Jul 27, 2020
@davidchisnall davidchisnall added needs-triage Bug does not yet have a priority assigned and removed needs-triage Bug does not yet have a priority assigned labels Jul 28, 2020
@prp prp mentioned this issue Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: compatibility Compatibility of existing workloads/apps area: sgx-lkl Core SGX-LKL functionality enhancement p1 Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants