Re: [Openvpn-devel] [PATCH] BUILD: enable CFG and Spectre mitigation for MSVC

2021-09-21 Thread Илья Шипицин
thanks,

I'll recheck and will send v2 soon

вт, 21 сент. 2021 г. в 16:49, Lev Stipakov :

> Hi,
>
> Sorry for the delay.
>
> I got "command line error D8016: '/ZI' and '/guard:cf' command-line
> options are incompatible" errors for Debug configuration,
> Release works fine. Looks like "Debug Information Format: Program
> Database for Edit and Continue" is not compatible with Control Flow
> Guard:
>
>
> https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard?view=msvc-160
>
> Let's apply those changes to Release configurations only.
>
> ke 15. syysk. 2021 klo 15.27 Ilya Shipitsin (chipits...@gmail.com)
> kirjoitti:
> >
> > found by BinSkim
> >
> > Signed-off-by: Ilya Shipitsin 
> > ---
> >  src/compat/Debug.props|  1 +
> >  src/compat/Release.props  |  1 +
> >  src/compat/compat.vcxproj |  6 ++
> >  src/openvpn/openvpn.vcxproj   | 12 
> >  src/openvpnmsica/openvpnmsica.props   |  1 +
> >  src/openvpnmsica/openvpnmsica.vcxproj |  6 ++
> >  src/openvpnserv/openvpnserv.vcxproj   |  6 ++
> >  src/tapctl/tapctl.vcxproj |  6 ++
> >  8 files changed, 39 insertions(+)
> >
> > diff --git a/src/compat/Debug.props b/src/compat/Debug.props
> > index 31bb9d91..810609bf 100644
> > --- a/src/compat/Debug.props
> > +++ b/src/compat/Debug.props
> > @@ -15,6 +15,7 @@
> >
> _DEBUG;%(PreprocessorDefinitions)
> >MultiThreadedDebugDLL
> >EditAndContinue
> > +  Guard
> >  
> >
> >
> > diff --git a/src/compat/Release.props b/src/compat/Release.props
> > index 63828b79..50eaa8de 100644
> > --- a/src/compat/Release.props
> > +++ b/src/compat/Release.props
> > @@ -15,6 +15,7 @@
> >MultiThreadedDLL
> >ProgramDatabase
> >
> NDEBUG;%(PreprocessorDefinitions)
> > +  Guard
> >  
> >  
> >true
> > diff --git a/src/compat/compat.vcxproj b/src/compat/compat.vcxproj
> > index 49824783..fe03a51a 100644
> > --- a/src/compat/compat.vcxproj
> > +++ b/src/compat/compat.vcxproj
> > @@ -38,33 +38,39 @@
> >  MultiByte
> >  true
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
> Label="Configuration">
> >  StaticLibrary
> >  MultiByte
> >  true
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"
> Label="Configuration">
> >  StaticLibrary
> >  MultiByte
> >  true
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
> Label="Configuration">
> >  StaticLibrary
> >  MultiByte
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
> Label="Configuration">
> >  StaticLibrary
> >  MultiByte
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"
> Label="Configuration">
> >  StaticLibrary
> >  MultiByte
> >  v142
> > +Spectre
> >
> >
> >
> > diff --git a/src/openvpn/openvpn.vcxproj b/src/openvpn/openvpn.vcxproj
> > index 5b3e0c6c..8d27f9c6 100644
> > --- a/src/openvpn/openvpn.vcxproj
> > +++ b/src/openvpn/openvpn.vcxproj
> > @@ -38,33 +38,39 @@
> >  true
> >  NotSet
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Release|x64'"
> Label="Configuration">
> >  Application
> >  true
> >  NotSet
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"
> Label="Configuration">
> >  Application
> >  true
> >  NotSet
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
> Label="Configuration">
> >  Application
> >  NotSet
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"
> Label="Configuration">
> >  Application
> >  NotSet
> >  v142
> > +Spectre
> >
> > Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"
> Label="Configuration">
> >  Application
> >  NotSet
> >  v142
> > +Spectre
> >
> >
> >
> > @@ -146,6 +152,7 @@
> >Level2
> >true
> >
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> > +  Guard
> >  
> >  
> >  
> > @@ -161,6 +168,7 @@
> >Level2
> >true
> >
> ..\compat;$(SolutionDir)include;$(SolutionDir);%(AdditionalIncludeDirectories)
> > +  Guard
> >  
> >  
> >  
> > @@ -176,6 +184,7 @@
> >Level2
> >true
> >
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> > +  Guard
> >  
> >  
> >  
> > @@ -191,6 +200,7 @@
> >Level2
> >true
> >
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> > +  Guard
> >  
> >  
> >  
> > @@ -206,6 +216,7 @@
> >Level2
> >true
> >
> 

Re: [Openvpn-devel] [PATCH] BUILD: enable CFG and Spectre mitigation for MSVC

2021-09-21 Thread Lev Stipakov
Hi,

Sorry for the delay.

I got "command line error D8016: '/ZI' and '/guard:cf' command-line
options are incompatible" errors for Debug configuration,
Release works fine. Looks like "Debug Information Format: Program
Database for Edit and Continue" is not compatible with Control Flow
Guard:

https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard?view=msvc-160

Let's apply those changes to Release configurations only.

ke 15. syysk. 2021 klo 15.27 Ilya Shipitsin (chipits...@gmail.com) kirjoitti:
>
> found by BinSkim
>
> Signed-off-by: Ilya Shipitsin 
> ---
>  src/compat/Debug.props|  1 +
>  src/compat/Release.props  |  1 +
>  src/compat/compat.vcxproj |  6 ++
>  src/openvpn/openvpn.vcxproj   | 12 
>  src/openvpnmsica/openvpnmsica.props   |  1 +
>  src/openvpnmsica/openvpnmsica.vcxproj |  6 ++
>  src/openvpnserv/openvpnserv.vcxproj   |  6 ++
>  src/tapctl/tapctl.vcxproj |  6 ++
>  8 files changed, 39 insertions(+)
>
> diff --git a/src/compat/Debug.props b/src/compat/Debug.props
> index 31bb9d91..810609bf 100644
> --- a/src/compat/Debug.props
> +++ b/src/compat/Debug.props
> @@ -15,6 +15,7 @@
>
> _DEBUG;%(PreprocessorDefinitions)
>MultiThreadedDebugDLL
>EditAndContinue
> +  Guard
>  
>
>
> diff --git a/src/compat/Release.props b/src/compat/Release.props
> index 63828b79..50eaa8de 100644
> --- a/src/compat/Release.props
> +++ b/src/compat/Release.props
> @@ -15,6 +15,7 @@
>MultiThreadedDLL
>ProgramDatabase
>
> NDEBUG;%(PreprocessorDefinitions)
> +  Guard
>  
>  
>true
> diff --git a/src/compat/compat.vcxproj b/src/compat/compat.vcxproj
> index 49824783..fe03a51a 100644
> --- a/src/compat/compat.vcxproj
> +++ b/src/compat/compat.vcxproj
> @@ -38,33 +38,39 @@
>  MultiByte
>  true
>  v142
> +Spectre
>
> Label="Configuration">
>  StaticLibrary
>  MultiByte
>  true
>  v142
> +Spectre
>
> Label="Configuration">
>  StaticLibrary
>  MultiByte
>  true
>  v142
> +Spectre
>
> Label="Configuration">
>  StaticLibrary
>  MultiByte
>  v142
> +Spectre
>
> Label="Configuration">
>  StaticLibrary
>  MultiByte
>  v142
> +Spectre
>
> Label="Configuration">
>  StaticLibrary
>  MultiByte
>  v142
> +Spectre
>
>
>
> diff --git a/src/openvpn/openvpn.vcxproj b/src/openvpn/openvpn.vcxproj
> index 5b3e0c6c..8d27f9c6 100644
> --- a/src/openvpn/openvpn.vcxproj
> +++ b/src/openvpn/openvpn.vcxproj
> @@ -38,33 +38,39 @@
>  true
>  NotSet
>  v142
> +Spectre
>
> Label="Configuration">
>  Application
>  true
>  NotSet
>  v142
> +Spectre
>
> Label="Configuration">
>  Application
>  true
>  NotSet
>  v142
> +Spectre
>
> Label="Configuration">
>  Application
>  NotSet
>  v142
> +Spectre
>
> Label="Configuration">
>  Application
>  NotSet
>  v142
> +Spectre
>
> Label="Configuration">
>  Application
>  NotSet
>  v142
> +Spectre
>
>
>
> @@ -146,6 +152,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> @@ -161,6 +168,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir)include;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> @@ -176,6 +184,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> @@ -191,6 +200,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> @@ -206,6 +216,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> @@ -221,6 +232,7 @@
>Level2
>true
>
> ..\compat;$(SolutionDir);%(AdditionalIncludeDirectories)
> +  Guard
>  
>  
>  
> diff --git a/src/openvpnmsica/openvpnmsica.props 
> b/src/openvpnmsica/openvpnmsica.props
> index 074635d0..9e934a73 100644
> --- a/src/openvpnmsica/openvpnmsica.props
> +++ b/src/openvpnmsica/openvpnmsica.props
> @@ -9,6 +9,7 @@
>  
>
> ..\compat;$(TAP_WINDOWS_HOME)/include;%(AdditionalIncludeDirectories)
>
> _WIN32_WINNT=_WIN32_WINNT_VISTA;%(PreprocessorDefinitions)
> +  Guard
>  
>  
>Windows
> diff --git a/src/openvpnmsica/openvpnmsica.vcxproj 
> b/src/openvpnmsica/openvpnmsica.vcxproj
> index c39b1240..11aa78bb 100644
> --- a/src/openvpnmsica/openvpnmsica.vcxproj
> +++ b/src/openvpnmsica/openvpnmsica.vcxproj
> @@ -40,18 +40,21 @@
>  v142
>  Unicode
>  true
> +Spectre
>
>