-
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
Exclude ARM Binaries from BA2025 analysis #650
Conversation
{ | ||
reasonForNotAnalyzing = MetadataConditions.ImageIsArmBinary; | ||
return notApplicable; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only logic update for this change. Specifically, excluding ARM binaries from BA2025 analysis in a similar fashion as ARM64 binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice code comment! Absolutely the info I was looking for. :)
@@ -10,6 +10,7 @@ public static class MetadataConditions | |||
public static readonly string ImageIsNotExe = SdkResources.MetadataCondition_ImageIsNotExe; | |||
public static readonly string ImageIsNotMachO = SdkResources.MetadataCondition_ImageIsNotMachO; | |||
public static readonly string CouldNotLoadPdb = SdkResources.MetadataCondition_CouldNotLoadPdb; | |||
public static readonly string ImageIsArmBinary = SdkResources.MetadataCondition_ImageIsArmBinary; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AnalysisApplicability expectedApplicability, | ||
string ruleName, | ||
string expectedReasonForNotAnalyzing) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created method for shared code.
@@ -460,6 +498,17 @@ private HashSet<string> GetTestFilesMatchingConditions(HashSet<string> metadataC | |||
result.Add(Path.Combine(testFilesDirectory, "DotnetNative_x86_VS2019_UniversalApp.exe")); | |||
} | |||
|
|||
if (metadataConditions.Contains(MetadataConditions.ImageIsArmBinary)) | |||
{ | |||
result.Add(Path.Combine(testFilesDirectory, "ARM_CETShadowStack_NotApplicable.exe")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string expectedReasonForNotAnalyzing) | ||
{ | ||
|
||
var context = new BinaryAnalyzerContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first line empty can be removed. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
src/ReleaseHistory.md
Outdated
@@ -7,6 +7,7 @@ | |||
* Bump ELFSharp from 2.14.0 to 2.15.0. [#631](https://github.com/microsoft/binskim/pull/631) | |||
* FEATURE: Enable BinSkim for MacOS. [#576](https://github.com/microsoft/binskim/pull/576) | |||
* Bump Sarif.Sdk by updating submodule from [4e9f606 to fc9a9df](https://github.com/microsoft/sarif-sdk/compare/4e9f606bb0e88428866e253352cdc70dc68f98cb...fc9a9dfb865096b5aaa9fa3651854670940f7459). [#638](https://github.com/microsoft/binskim/pull/638) | |||
* BUGFIX: Fix `BA2025.EnableShadowStack` warning for ARM Binaries which cannot use `/CETCOMPAT`. [#650](https://github.com/microsoft/binskim/pull/650) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUGFIX: Fix
BA2025.EnableShadowStack
warning for ARM Binaries which cannot use/CETCOMPAT
.
I see a sample below:
FALSE POSITIVE FIX: Skip PDB-driven analysis for the generated .NET core native bootstrap exe (which is not user-controllable code).
See if we think this template is better for this change
FALSE POSITIVE FIX: Skip rule xxx for xxx (reason) #Closed
@@ -47,3 +47,40 @@ Also create two user functions `userfn_use_safebuffers_1()` and `userfn_use_safe | |||
A simple `Windows Kernel Mode Driver` program, created with `Visual Studio 2019` that generates a .exe and associated .pdb file. Code to reproduce: | |||
Use `NTSTATUS GsDriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath)` as entry point and do not decorated with `__declspec(safebuffers)`. | |||
No user functions decorated with `__declspec(safebuffers)`. | |||
|
|||
## ARM64_CETShadowStack_NotApplicable.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a empty line consistent with others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.VerifyApplicability( | ||
HashSet<string> notApplicableArm64 = new HashSet<string>() { MetadataConditions.ImageIsArm64BitBinary }; | ||
|
||
this.VerifyApplicabililtyByConditionsOnly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing issue #627 by: