BinSkim BA2021 on System.Private.CoreLib.dll
Repro steps:
- Build CoreCLR (
build.cmd) - Run BinSkim (https://github.com/Microsoft/binskim/blob/master/README.md#for-users)
Expected: No issues
Actual: Defect Id BA2021 is reported on System.Private.CoreLib.dll
Details: PE sections should not be marked as both writable and executable. This condition makes it easier for an attacker to exploit memory corruption vulnerabilities, as it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Be sure to disable incremental linking in release builds, as this feature creates a writable and executable section named '.textbss' in order to function.'System.Private.CoreLib.dll' contains PE section(s) (.xdata) that are both writable and executable. Writable and executable memory segments make it easier for an attacker to exploit memory corruption vulnerabilities, because it may provide an attacker executable location(s) to inject shellcode. To resolve this issue, configure your tools to not emit memory sections that are writable and executable. For example, look for uses of /SECTION on the linker command line for C and C++ programs, or #pragma section in C and C++ source code, which mark a section with both attributes. Enabling incremental linking via the /INCREMENTAL argument (the default for Microsoft Visual Studio debug build) can also result in a writable and executable section named 'textbss'. For this case, disable incremental linking (or analyze an alternate build configuration that disables this feature) to resolve the problem.
cc @vitek-karas
@vitek-karas Do you expect 2.1 System.Private.CoreLib to pass BinSkim, which I expect requires no write-execute sections in the image? If not, could you move this to Future?
@jeffschwMSFT
Fragile ngen support has been deleted.