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

[PATCH][xennet] Fix compiler options


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 5 May 2022 08:04:09 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 05 May 2022 07:04:18 +0000
  • Ironport-data: A9a23:XbJz7aNC5bUbRT3vrR3zl8FynXyQoLVcMsEvi/4bfWQNrUojg2EOz GUYXWiGO/rbYmf2ftl+OYuwp0gP6MPUndRhQQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFYMpBsJ00o5wbZk2tMw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z1 8lf6cyAVh8TM/PFscIRcUV4SSxDFPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALK9bmOsUEv3B8zRnSDOo8QICFSKLPjTNd9Gho2pEeTaaHD yYfQSUycwSQYwZSAUhUOp4igdyovjr9VyIN/Tp5ooJoujOOnWSdyoPFL9vTP8SUAMlYgEucj mbH5HjiRAEXMsSFzjiI+W7qgfXA9R4XQ6pLSuf+rKQzxgTOmCpDU3X6SGdXv9GmllziC+JAM 3YZpCMHi6QQqGzxQ+TUCkjQTGG/gjYQXN9ZEusf4Q6Ly7bJ7wvxOlXoXgKte/R96pZoGGVCO kuh2oqwWGcx6OH9pWe1rO/8kN+kBcQCwYbujwcgRBBN3dTsqZpbYvnnHoc6S/7dYjEY9FjNL 9G2QMoW2u17YS0jjfzTEbX7b9WE/MKhc+LNzl+LNl9JFysgDGJfW6Sm6ELA8dFLJ5uDQ1+Ks RAswpbDtb9WXcHUznDUHI3h+Y1FAN7fa1XhbaNHRcF9p1xBBVb+FWyv3N2ODBgwaZtVEdMYS ETSpRlQ9Pdu0IiCNsdKj3aKI51yl8DITI29PtiNN4YmSsUhJWevoXA1DWbNjj+FraTZufxmU XttWZ33Vihy5GUO5GfeetrxJpd2mHBjnT+DGcGTItbO+eP2WUN5gIwtaDOmBt3VJovdyOkJ2 76z7/e39ig=
  • Ironport-hdrordr: A9a23:ZK8OQq6A2WqsnEuYZAPXwMTXdLJyesId70hD6qhwISY6TiX+rb HLoB17726TtN9/YhEdcLy7VJVoIkmskKKdg7NhXotKNTOO0ADDQb2KhbGSpAEIcBeeygcy78 hdmtBFeb/NMWQ=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

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 xennet_coinst.dll

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 vs2019/xennet/xennet.vcxproj               | 9 ++++++++-
 vs2019/xennet_coinst/xennet_coinst.vcxproj | 3 +++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/vs2019/xennet/xennet.vcxproj b/vs2019/xennet/xennet.vcxproj
index cee1325..469ad09 100644
--- a/vs2019/xennet/xennet.vcxproj
+++ b/vs2019/xennet/xennet.vcxproj
@@ -21,6 +21,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);NDIS_MINIPORT_DRIVER;NDIS_WDM=1;NDIS630_MINIPORT=1;NDIS660_MINIPORT=1;NDIS685_MINIPORT=1;POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;</AdditionalIncludeDirectories>
@@ -32,7 +33,6 @@
       
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>$(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
@@ -45,11 +45,18 @@
     <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/xennet_coinst/xennet_coinst.vcxproj 
b/vs2019/xennet_coinst/xennet_coinst.vcxproj
index d2c5d07..ea789f0 100644
--- a/vs2019/xennet_coinst/xennet_coinst.vcxproj
+++ b/vs2019/xennet_coinst/xennet_coinst.vcxproj
@@ -19,6 +19,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -31,6 +33,7 @@
     <Link>
       
<ModuleDefinitionFile>../../src/coinst/xennet_coinst.def</ModuleDefinitionFile>
       
<AdditionalDependencies>setupapi.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <DriverSign>
       <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
-- 
2.32.0.windows.1




 


Rackspace

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