-
Notifications
You must be signed in to change notification settings - Fork 285
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
cmake: Disable Control-Flow check instrumentation #649
base: master
Are you sure you want to change the base?
Conversation
Disable Control-Flow protection (CET) for the Baseline interpreter. This is controlled by -fcf-protection GCC/Clang compiler flag and may be enabled by default depending on the OS configuration. This is disabled because it slightly affects performance and code size. If the CF protection is desired it should be enabled uniformly in all compilers which support it. Somehow, applying [[nocf_check]] attribute has no desired effect. See GCC documentation: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection
GCC 13, Skylake
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #649 +/- ##
=======================================
Coverage 97.33% 97.33%
=======================================
Files 80 80
Lines 7739 7739
=======================================
Hits 7533 7533
Misses 206 206
Flags with carried forward coverage won't be shown. Click here to find out more. |
GCC 12, Haswell
|
The savings are impressive, but the description is scary:
So ideally we could disable this, but enable is specifically at some places where risk is present? |
We need to consult this with some security experts. Originally, I wanted to disable this only for baseline interpreter, but the attribute does not work. Probably worth to report a bug. But we can also disable this per-file basis. It may have more sense to have this enabled for bytecode analysis. The risk is that if there is a bug in EVM someone will be able to take over the process the EVM is running in and e.g. steal some information or mess up how it behave in the p2p network. This seems unlikely though. The attacker will be still able to crash the node. Oh and the benchmarks are shaky. The improvements may come from smaller code size and code layout change. |
Disable Control-Flow protection (CET) for the Baseline interpreter. This is controlled by -fcf-protection GCC/Clang compiler flag and may be enabled by default depending on the OS configuration.
This is disabled because it slightly affects performance and code size. If the CF protection is desired it should be enabled uniformly in all compilers which support it.
Somehow, applying [[nocf_check]] attribute has no desired effect.
See GCC documentation:
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection