[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH][xenvif] Fix compiler options


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Durrant, Paul" <xadimgnik@xxxxxxxxx>
  • Date: Fri, 6 May 2022 15:08:54 +0100
  • Delivery-date: Fri, 06 May 2022 14:09:01 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 05/05/2022 08:05, Owen Smith wrote:
Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker
command lines
These changes were prompted by binskim https://github.com/microsoft/binskim

Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still
       reported for xenvif_coinst.dll

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

This and similar patches for the other drivers...

Acked-by: Paul Durrant <paul@xxxxxxx>

---
  vs2019/xenvif/xenvif.vcxproj               | 8 +++++++-
  vs2019/xenvif_coinst/xenvif_coinst.vcxproj | 3 +++
  2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxproj
index 39427b7..52473b8 100644
--- a/vs2019/xenvif/xenvif.vcxproj
+++ b/vs2019/xenvif/xenvif.vcxproj
@@ -19,6 +19,7 @@
    </PropertyGroup>
    <ItemDefinitionGroup>
      <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
        
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
        
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <IntrinsicFunctions>true</IntrinsicFunctions>
@@ -30,7 +31,6 @@
        
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      </ResourceCompile>
      <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
        
<AdditionalDependencies>$(DDK_LIB_PATH)/Rtlver.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/ksecdd.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
        
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
        <CETCompat>true</CETCompat>
@@ -43,11 +43,17 @@
      <ClCompile>
        
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
+    </Link>
    </ItemDefinitionGroup>
    <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
      <ClCompile>
        
<PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+    </Link>
    </ItemDefinitionGroup>
    <ItemDefinitionGroup Condition="'$(Configuration)'=='Windows 8 Release'">
      <ClCompile>
diff --git a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj 
b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj
index ccf4135..ae187fc 100644
--- a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj
+++ b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj
@@ -22,6 +22,8 @@
    </PropertyGroup>
    <ItemDefinitionGroup>
      <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
        
<PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <WarningLevel>EnableAllWarnings</WarningLevel>
        
<DisableSpecificWarnings>4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
@@ -33,6 +35,7 @@
      <Link>
        
<ModuleDefinitionFile>../../src/coinst/xenvif_coinst.def</ModuleDefinitionFile>
        
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
      </Link>
      <DriverSign>
        <FileDigestAlgorithm>sha256</FileDigestAlgorithm>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.