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

[PATCH][xenbus] Fix compiler options


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 5 May 2022 08:02:45 +0100
  • Authentication-results: esa1.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:02:59 +0000
  • Ironport-data: A9a23:rB9tX6lPW8+18MMu9s2nUcHo5gzXJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJLDG6Ebq7YZjOnctoiaN+zpxlVv8XTzYVlSANs/yhmHyMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EsLd9IR2NYy24DkW17V4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYc1k3YYPvuP4kejIGQgVbIfBKoKHVPi3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNFbZ3bvwme/lDLk37iggBJCD0Ic3vW5ty3fCCPc6QbjIQrnQ5M8e1zA17ixLNamHP 5FDNms0BPjGSwwREQsHMpcnpc25tkXuWQ9etW+VjoNitgA/yyQuieOwYbI5YOeiWsRT216G4 27L4Wn9KhUbL8CEjyqI9Gq2ge3Clj+9X5gdfIBU7dYz3gfVnDZKTkRLCx3r+pFVl3JSRfpld VJL1AkOt5Eb3xL6avzhAhHgvmyb60t0t8VrL8U27wSEy6zx6gmfB3QZQjMpVOHKpPPaVhRxi AbXwoqB6ShH9eTMFCnDruv8QSaaY3B9EIMUWcMToeLpCfHHqZp7sB/AR80L/EWd3oysQmGYL 9xnQUEDa1QvYSwjiv3TEbPv2WvESn31oukdvF+/Y45dxlklDLNJnqTxgbQh0d5OLZyCUn6Kt 2Uels6V4YgmVM/QzXPVELVURu3wu55p1QEwZnY1RPEcG8mFoSb/Lei8HhkjTKuWDir0UWCwO xKC0e+gzJRSIGGrfcdKj3GZUKwXIVzbPY29DJj8N4MWCrAoLVPv1Hw+NCa4gjG2+GBxwP5XB HtuWZv1ZZrsIf88l2TeqiZ0+eJD+x3SMkuOG8Cml0j3jev2ibz8Ye5tDWZip9sRtMusyDg5O f4GXydW432ziNHDXxQ=
  • Ironport-hdrordr: A9a23:8rzuiaCeU16zqJPlHemm55DYdb4zR+YMi2TC1yhKJiC9Ffbo8v xG/c5rsiMc5wxxZJhNo7290cq7MBHhHPxOgbX5VI3KNGKNhILBFvAH0WKI+VPd8kPFmtK1rZ 0QEJRDNA==
  • 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 xenbus_coinst.dll and xenbus_monitor.exe
      Rule BA2007 (Error_WarningsDisabled) is still reported for all drivers
      Rule BA2018 (Error, SSE table is empty) is still reported for x86 xen.sys

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 vs2019/xen/xen.vcxproj                       | 1 +
 vs2019/xenbus/xenbus.vcxproj                 | 8 +++++++-
 vs2019/xenbus_coinst/xenbus_coinst.vcxproj   | 3 +++
 vs2019/xenbus_monitor/xenbus_monitor.vcxproj | 3 +++
 vs2019/xenfilt/xenfilt.vcxproj               | 8 +++++++-
 5 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/vs2019/xen/xen.vcxproj b/vs2019/xen/xen.vcxproj
index 6aaebf5..f0e1b98 100644
--- a/vs2019/xen/xen.vcxproj
+++ b/vs2019/xen/xen.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
diff --git a/vs2019/xenbus/xenbus.vcxproj b/vs2019/xenbus/xenbus.vcxproj
index 00b39a9..d7b94bd 100644
--- a/vs2019/xenbus/xenbus.vcxproj
+++ b/vs2019/xenbus/xenbus.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;</AdditionalIncludeDirectories>
@@ -30,7 +31,6 @@
       
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>$(ProjectDir)..\$(ConfigurationName)\$(Platform)\xen.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/procgrp.lib;$(DDK_LIB_PATH)/rtlver.lib;%(AdditionalDependencies)</AdditionalDependencies>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
@@ -43,11 +43,17 @@
     <ClCompile>
       
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions);_X86_</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
     <ClCompile>
       
<PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions);_AMD64_</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Windows 8 Release'">
     <ClCompile>
diff --git a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj 
b/vs2019/xenbus_coinst/xenbus_coinst.vcxproj
index 2e7a6e7..b37e1a5 100644
--- a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj
+++ b/vs2019/xenbus_coinst/xenbus_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>
@@ -31,6 +33,7 @@
       
<ModuleDefinitionFile>../../src/coinst/xenbus_coinst.def</ModuleDefinitionFile>
       
<AdditionalDependencies>setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>false</EnableCOMDATFolding>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
diff --git a/vs2019/xenbus_monitor/xenbus_monitor.vcxproj 
b/vs2019/xenbus_monitor/xenbus_monitor.vcxproj
index 8652ac4..54272ec 100644
--- a/vs2019/xenbus_monitor/xenbus_monitor.vcxproj
+++ b/vs2019/xenbus_monitor/xenbus_monitor.vcxproj
@@ -22,6 +22,8 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
+      <SDLCheck>true</SDLCheck>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>EnableAllWarnings</WarningLevel>
@@ -33,6 +35,7 @@
     </ClCompile>
     <Link>
       
<AdditionalDependencies>wtsapi32.lib;cfgmgr32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <CETCompat>true</CETCompat>
     </Link>
     <ResourceCompile>
       
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
diff --git a/vs2019/xenfilt/xenfilt.vcxproj b/vs2019/xenfilt/xenfilt.vcxproj
index ef53280..270d2e4 100644
--- a/vs2019/xenfilt/xenfilt.vcxproj
+++ b/vs2019/xenfilt/xenfilt.vcxproj
@@ -19,6 +19,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
+      <AdditionalOptions>/ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
       
<PreprocessorDefinitions>PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       
<AdditionalIncludeDirectories>$(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;</AdditionalIncludeDirectories>
@@ -30,7 +31,6 @@
       
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <Link>
-      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
       
<AdditionalDependencies>$(ProjectDir)..\$(ConfigurationName)\$(Platform)\xen.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies)</AdditionalDependencies>
       
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
       <CETCompat>true</CETCompat>
@@ -43,11 +43,17 @@
     <ClCompile>
       
<PreprocessorDefinitions>__i386__;%(PreprocessorDefinitions);_X86_</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
     <ClCompile>
       
<PreprocessorDefinitions>__x86_64__;%(PreprocessorDefinitions);_AMD64_</PreprocessorDefinitions>
     </ClCompile>
+    <Link>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Windows 8 Release'">
     <ClCompile>
-- 
2.32.0.windows.1




 


Rackspace

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