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

[PATCH][xenvbd] Fix compiler options


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 5 May 2022 08:04:53 +0100
  • Authentication-results: esa3.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:05:02 +0000
  • Ironport-data: A9a23:vtlGE6hilDs6u34O+eeENeIvX161NhAKZh0ujC45NGQN5FlHY01je htvUWqAOPreZjfwc4oib9yw9B8DusCBz4djHARq+ygyEy0b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXlvQ4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YQYYDrTdqvktaEMCFghGOat33ZbgLlHq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bknZ/wDefFvMnXZDrSKTW/95Imjw3g6iiGN6BP 5RDM2cxMHwsZTVAAnFJCtFnht2loXj6bxtjo3iJiOkotj27IAtZj+G2bYu9lsaxbdpUmAOAu CfK8nr0BjkeNceD0nyV/3S0nOjNkCjnHoUIG9WFGuVC2QPJgDZJUVtPCAX98aLRZlOCt8x3K n0k4zscsJgJrhauZ+H5WSydiVmLl0tJMzZPKNES5AaIw6vSxg+WAGkYUzJMAOAbWN8KqS8Cj QHQwY6wbdB7mPjMEC/GqO/Ixd+nEXJNRVLucxPoWufsDzPLhIgoxizCQd94eEJepo2kQGqgq 9xmQcVXulnysSLp//jjlbwkq2j1znQscuLSzl+NNl9JFisjOOaYi3WAsDA3F8poIoeDVUWmt 3MZgcWY5+1mJcjTyXXSGLVdRev1vqrt3NjgbblHRcJJythQ0yT7IdA4DM9WeS+FzfroiRe2O RSO6Gu9FbdYPWewbL8fXm5CI59C8EQULvy8Dqq8RoMXOvBZLVbblAkzNR/49z28yyAEzPBgU ap3hO7xVB72/4w8l2HoLwrcuJd2rh0DKZT7GM6rkkz7gebPDJNXIJ9cWGazgikCxPvsiG3oH xx3bqNmFz03vDXCXxTq
  • Ironport-hdrordr: A9a23:V5Uota7YKNcn14eyHgPXwMTXdLJyesId70hD6qhwISY6TiX+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 xenvbd_coinst.dll and xencrsh.sys
      Rule BA2018 (Error, empty SEH table) is still reported for xencrsh.sys

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 vs2019/xencrsh/xencrsh.vcxproj             |  1 +
 vs2019/xendisk/xendisk.vcxproj             | 10 +++++++---
 vs2019/xenvbd/xenvbd.vcxproj               |  8 +++++++-
 vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj |  3 +++
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/vs2019/xencrsh/xencrsh.vcxproj b/vs2019/xencrsh/xencrsh.vcxproj
index 9f80df3..d9c8bef 100644
--- a/vs2019/xencrsh/xencrsh.vcxproj
+++ b/vs2019/xencrsh/xencrsh.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
diff --git a/vs2019/xendisk/xendisk.vcxproj b/vs2019/xendisk/xendisk.vcxproj
index c8370ff..9b4874a 100644
--- a/vs2019/xendisk/xendisk.vcxproj
+++ b/vs2019/xendisk/xendisk.vcxproj
@@ -19,8 +19,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<AdditionalIncludeDirectories>..\..\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <BufferSecurityCheck>false</BufferSecurityCheck>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -31,7 +31,6 @@
       
<AdditionalIncludeDirectories>..\..\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
@@ -44,11 +43,16 @@
     <ClCompile>
       
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-  </ItemDefinitionGroup>
+    <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/xenvbd/xenvbd.vcxproj b/vs2019/xenvbd/xenvbd.vcxproj
index 6f68f0c..7cae5f0 100644
--- a/vs2019/xenvbd/xenvbd.vcxproj
+++ b/vs2019/xenvbd/xenvbd.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
@@ -30,7 +31,6 @@
       
<AdditionalIncludeDirectories>..\..\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>$(ProjectDir)..\$(ConfigurationName)\$(Platform)\xencrsh.lib;$(DDK_LIB_PATH)/storport.lib;$(DDK_LIB_PATH)/libcntpr.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/xenvbd_coinst/xenvbd_coinst.vcxproj 
b/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj
index 9a66f45..5a0b918 100644
--- a/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj
+++ b/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj
@@ -18,6 +18,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>
@@ -30,6 +32,7 @@
     <Link>
       
<ModuleDefinitionFile>../../src/coinst/xenvbd_coinst.def</ModuleDefinitionFile>
       
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-- 
2.32.0.windows.1




 


Rackspace

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