-
Notifications
You must be signed in to change notification settings - Fork 156
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
BA2024 - Defect : EnableSpectreMitigations #288
Comments
Any feedback or pointer is appreciated. |
hey i have the same issue. Interesting is that point that this only happens when /QSpectre switch is enabled in a debug build or a managed c++ application /clr with the release version everything is fine so i assume that really the debug msvcrtd.lib is not build with spectre |
Seems like |
@yitam @TobiasFunk , sorry for the delay. Are you still facing this issue? |
i changed my projects to not run binskim on debug builds, but manually i shortly checked and at least i can't see the error any more (we changed to a new compiler version in the meanwhile) |
@TobiasFunk , we observed that if you run in debug, it won't work. I will try to change the text in the rule itself or add some kind of hint so people will know to run this validation only on release mode. |
@eddynaka yes I ran on debug build as well. I will give it a try using the release build then. |
@yitam , thank you! let me know the result. Ping me on teams if you face any issue. |
@eddynaka with the release build I still got the following. Is there anything else I should do? It's been months since I last updated Visual Studio, but is that the cause?
|
@yitam , looking at my current installation I have:
Also, check if you are using control flow guard. |
Yes @eddynaka control flow guard is on, but I'm using Visual Studio 2017. I will upgrade later if the version is the reason.
|
Thanks @eddynaka it seems this issue has disappeared when compiling the binaries with Visual Studio 2019. Please go ahead to close this issue if you like. |
Good to know! So, vs2019 and release mode is the way to go. Will remember that. |
For anybody who stumbles upon this post, apparently you also need to specify '/Zi' together with '/Qspectre' in order for binskim to detect this flag even for release builds. |
We are facing the same issue with a C++ library compiled using cmake. CMake properly identifies the required settings if we ask it to enable spectra mitigations (we validated the generated vcproj file). However, binskim cannot validate this statement without setting /Zi (as it was suggested by @jeofyoung), but this leads to crashes with our code base during runtime. |
We're still seeing this warning in VS 2022, and we specify both |
I ran binskim on our binaries but received the following issue as defect. Already updated to the latest Visual Studio 2017 v15.9.23 with these installed:
What else can I do to resolve this defect?
The text was updated successfully, but these errors were encountered: