-
Notifications
You must be signed in to change notification settings - Fork 77
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
Some functions call cpuid #5
Comments
It's not a bug, this SIGILL is by design. |
If I understand correctly, once this package is built, the TestApp should be launched to see if everything works as intended. There appears to be a bug in the Once this is in place, the build fails - upon more detailed examination, this causes TestApp to blow up with a core dump. I've narrowed it down to the same spot as @mechalas . This leads me to think that the exception handler which you have referenced wasn't set up properly to handle invocations of the CPUID instruction. I suspect this may have something to do with the constructor attribute of:
What are your thoughts on this? Here's my build output and gcc -v: |
Regarding the CPUID exception handler, when debugging your enclave using sgx-gdb you'll get 4 SIGILL signals once this CPUID instruction called and cpuid exception handler invoked, hitting "c" 4 times should make the enclave continue executing. This is a know behavior that doesn't terminated or affect enclave execution. Regarding the code dump, I'll check it. |
Upon further investigation, I've determined that the exception handler gets initialized and called, and appears to handle CPUID gracefully. It appears to be bailing out here:
|
So it seems that free() calls fail when they are called by RSA_free and EC_KEY_free. Once I comment those out, everything works and all tests pass. |
Some functions inside of OpenSSL make calls to cpuid via OPENSSL_ia32_cpuid which are not captured by this library, leading to a SIGILL at runtime:
The source for OPENSSL_ia32_cpuid is in crypto/x86_64cpuid.s (and crypto/x86cpuid.s when in 32-bit ode). These files are dynamically-generated assembly, created when OpenSSL is being compiled via the perl script in crypto/x86_64cpuid.pl (and crypto/x86cpuid.pl when building in 32-bit mode).
The text was updated successfully, but these errors were encountered: