You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2021/05/26 11:30:38 UTC

[GitHub] [incubator-teaclave-sgx-sdk] longtomjr opened a new issue #341: Will panicking inside of enclave code cause undefined behavior

longtomjr opened a new issue #341:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/341


   Afaik, unwinding over an FFI boundary with rust is explicitly undefined. 
   I did a bit of digging, but it is not clear to me that it is safe to panic inside of the SGX runtime.
   
   If panicking with unwind will cause undefined behavior, is there a recommended way to panic without triggering UB? (abort on panic etc.).
   
   Any information or input on where I should go looking will help a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] longtomjr commented on issue #341: Will panicking inside of enclave code cause undefined behavior

Posted by GitBox <gi...@apache.org>.
longtomjr commented on issue #341:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/341#issuecomment-849409482


   Hi. Thanks a lot for the reply! I just wanted to check that we are not introducing UB if we panic inside of the enclave code. From what I looked at it seemed like there were no cross FFI unwinding, I just wanted to make sure.
   
   This question were just about panics generated inside of rust code. From my understanding CPU-generated panics can be handled using the exception handlers from `sgx_trts::veh`.
   
   Thanks again!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] longtomjr closed issue #341: Will panicking inside of enclave code cause undefined behavior

Posted by GitBox <gi...@apache.org>.
longtomjr closed issue #341:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/341


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave-sgx-sdk] dingelish commented on issue #341: Will panicking inside of enclave code cause undefined behavior

Posted by GitBox <gi...@apache.org>.
dingelish commented on issue #341:
URL: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/341#issuecomment-849096081


   hi @longtomjr ! we are aware of this UB since the first day we started this project. so by design, we do not allow any cross FFI-boundary unwinding. and we support Rust `catch_unwind` to handle exceptions within the Rust space.
   
   https://github.com/apache/incubator-teaclave-sgx-sdk/blob/master/samplecode/unit-test/enclave/src/test_exception.rs#L65
   
   Intel SGX SDK never throw exceptions outside, so we're good and we don't catch Intel SGX SDK's C++ exceptions.
   
   I'm not clear if you are confusing between "the panic generated by CPU", and "panic generated by unwrap". please elaborate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org