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

[xennet PATCH 3/3] Enable KASAN build support



KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@xxxxxxxxx>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
        [string]$SignMode = "TestSign",
        [switch]$CodeQL,
        [switch]$Sdv,
-       [switch]$CodeAnalysis
+       [switch]$CodeAnalysis,
+       [switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
                Arch = $Arch;
                Type = $Type;
                SignMode = $SignMode;
-               CodeAnalysis = $CodeAnalysis
+               CodeAnalysis = $CodeAnalysis;
+               Kasan = $Kasan
                }
        & ".\msbuild.ps1" @params
        if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index d410acd..01f6303 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
        [Parameter(Mandatory = $true)]
        [string]$Type,
        [string]$SignMode = "TestSign",
-       [switch]$CodeAnalysis
+       [switch]$CodeAnalysis,
+       [switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
                [string]$Platform,
                [string]$Target = "Build",
                [string]$Inputs = "",
-               [switch]$CodeAnalysis
+               [switch]$CodeAnalysis,
+               [switch]$Kasan
        )
 
        $c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
                $c += "/p:RunCodeAnalysis=true "
                $c += "/p:EnablePREFast=true "
        }
+       if ($Kasan) {
+               $c += "/p:EnableKASAN=true "
+       }
 
        $c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-       Run-MSBuild $solutionpath $SolutionName $configuration[$Type] 
$platform[$Arch] -CodeAnalysis:$CodeAnalysis
+       Run-MSBuild $solutionpath $SolutionName $configuration[$Type] 
$platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1




 


Rackspace

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