From b2f6209bdda1dae1bfb01a9e23d0aba1d8b93c74 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 13 May 2025 16:41:19 -0700 Subject: [PATCH 1/2] Add more OneFuzz pipelines --- .../pipelines/DirectXTK-OneFuzz-Audio.yml | 128 ++++++++++++++++++ .../pipelines/DirectXTK-OneFuzz-Meshes.yml | 127 +++++++++++++++++ .azuredevops/pipelines/DirectXTK-OneFuzz.yml | 24 +--- 3 files changed, 261 insertions(+), 18 deletions(-) create mode 100644 .azuredevops/pipelines/DirectXTK-OneFuzz-Audio.yml create mode 100644 .azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml diff --git a/.azuredevops/pipelines/DirectXTK-OneFuzz-Audio.yml b/.azuredevops/pipelines/DirectXTK-OneFuzz-Audio.yml new file mode 100644 index 000000000..667e55896 --- /dev/null +++ b/.azuredevops/pipelines/DirectXTK-OneFuzz-Audio.yml @@ -0,0 +1,128 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# https://go.microsoft.com/fwlink/?LinkId=248929 + +# Builds the library using CMake and submit for file fuzzing for audio formats + +schedules: +- cron: "0 11 10 * *" + displayName: 'Submit for File Fuzzing (Monthly)' + branches: + include: + - main + always: true + +trigger: none +pr: none + +resources: + repositories: + - repository: self + type: git + ref: refs/heads/main + - repository: testRepo + name: walbourn/directxtktest + type: github + endpoint: microsoft + ref: refs/heads/main + +name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) + +variables: + Codeql.Enabled: false + VS_GENERATOR: 'Visual Studio 17 2022' + WIN11_SDK: '10.0.22000.0' + +pool: + vmImage: windows-2022 + +jobs: +- job: FUZZ_BUILD + displayName: 'Build for file fuzzing (WAV, XWB)' + steps: + - checkout: self + clean: true + fetchTags: false + fetchDepth: 1 + path: 's' + - checkout: testRepo + displayName: Fetch Tests + clean: true + fetchTags: false + fetchDepth: 1 + path: 's/Tests' + - task: CMake@1 + displayName: 'CMake (MSVC): Config with ASan' + inputs: + cwd: $(Build.SourcesDirectory) + cmakeArgs: > + -G "$(VS_GENERATOR)" -A x64 -B out + -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) + -DBUILD_TOOLS=OFF -DBUILD_XAUDIO_WIN10=ON -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF + -DBUILD_AUDIO_FUZZING=ON + - task: CMake@1 + displayName: 'CMake (MSVC): Build with ASan' + inputs: + cwd: $(Build.SourcesDirectory) + cmakeArgs: --build out -v --config RelWithDebInfo + - task: CopyFiles@2 + displayName: Copy fuzzer + inputs: + Contents: | + build\OneFuzzConfig.json + out\bin\RelWithDebInfo\fuzzloaders.exe + TargetFolder: .drop + OverWrite: true + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy symbols + inputs: + Contents: | + out\bin\RelWithDebInfo\fuzzloaders.pdb + TargetFolder: .drop\symbols + OverWrite: true + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy seed files + inputs: + Contents: | + Tests\BasicAudioTest\Alarm01.wav + Tests\BasicAudioTest\Alarm01_adpcm.wav + Tests\BasicAudioTest\Alarm01_float.wav + Tests\BasicAudioTest\Alarm01_xwma.wav + Tests\BasicAudioTest\ADPCMdroid.xwb + Tests\BasicAudioTest\wavebank.xwb + Tests\BasicAudioTest\xwmadroid.xwb + TargetFolder: .drop\seeds + OverWrite: true + flattenFolders: true + + - task: PowerShell@2 + displayName: Copy OneFuzz setup script + inputs: + targetType: 'inline' + script: | + Copy-Item -Path .\build\onefuzz-setup.ps1 -Destination .drop/setup.ps1 + + - task: MSBuild@1 + displayName: 'Copy ASan binaries' + inputs: + solution: build/CopyASAN.targets + msbuildArguments: /p:TargetFolder=$(Build.SourcesDirectory)\.drop + msbuildVersion: 17.0 + msbuildArchitecture: x64 + - task: PowerShell@2 + displayName: List drop files + inputs: + targetType: inline + script: | + Get-ChildItem ".drop" -Recurse | select FullName + + - task: onefuzz-task@0 + displayName: 'Submit to OneFuzz' + inputs: + onefuzzOSes: 'Windows' + env: + onefuzzDropDirectory: $(Build.SourcesDirectory)\.drop + SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml b/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml new file mode 100644 index 000000000..b14538cc9 --- /dev/null +++ b/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml @@ -0,0 +1,127 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# https://go.microsoft.com/fwlink/?LinkId=248929 + +# Builds the library using CMake and submit for file fuzzing for meshes + +schedules: +- cron: "0 11 20 * *" + displayName: 'Submit for File Fuzzing (Monthly)' + branches: + include: + - main + always: true + +trigger: none +pr: none + +resources: + repositories: + - repository: self + type: git + ref: refs/heads/main + - repository: testRepo + name: walbourn/directxtktest + type: github + endpoint: microsoft + ref: refs/heads/main + +name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) + +variables: + Codeql.Enabled: false + VS_GENERATOR: 'Visual Studio 17 2022' + WIN11_SDK: '10.0.22000.0' + +pool: + vmImage: windows-2022 + +jobs: +- job: FUZZ_BUILD + displayName: 'Build for file fuzzing (CMO, SDKMESH, VBO)' + steps: + - checkout: self + clean: true + fetchTags: false + fetchDepth: 1 + path: 's' + - checkout: testRepo + displayName: Fetch Tests + clean: true + fetchTags: false + fetchDepth: 1 + path: 's/Tests' + - task: CMake@1 + displayName: 'CMake (MSVC): Config with ASan' + inputs: + cwd: $(Build.SourcesDirectory) + cmakeArgs: > + -G "$(VS_GENERATOR)" -A x64 -B out + -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) + -DBUILD_TOOLS=OFF -DBUILD_XAUDIO_WIN10=ON -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF + - task: CMake@1 + displayName: 'CMake (MSVC): Build with ASan' + inputs: + cwd: $(Build.SourcesDirectory) + cmakeArgs: --build out -v --config RelWithDebInfo + - task: CopyFiles@2 + displayName: Copy fuzzer + inputs: + Contents: | + build\OneFuzzConfig.json + out\bin\RelWithDebInfo\fuzzloaders.exe + TargetFolder: .drop + OverWrite: true + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy symbols + inputs: + Contents: | + out\bin\RelWithDebInfo\fuzzloaders.pdb + TargetFolder: .drop\symbols + OverWrite: true + flattenFolders: true + - task: CopyFiles@2 + displayName: Copy seed files + inputs: + Contents: | + Tests\AnimTest\teapot.cmo + Tests\DGSLTest\teapot_unlit.cmo + Tests\ModelTest\cup.sdkmesh + Tests\AnimTest\soldier.sdkmesh + Tests\PBRModelTest\BrokenCube.sdkmesh + Tests\ModelTest\player_ship_a.vbo + Tests\PBRTest\BrokenCube.vbo + TargetFolder: .drop\seeds + OverWrite: true + flattenFolders: true + + - task: PowerShell@2 + displayName: Copy OneFuzz setup script + inputs: + targetType: 'inline' + script: | + Copy-Item -Path .\build\onefuzz-setup.ps1 -Destination .drop/setup.ps1 + + - task: MSBuild@1 + displayName: 'Copy ASan binaries' + inputs: + solution: build/CopyASAN.targets + msbuildArguments: /p:TargetFolder=$(Build.SourcesDirectory)\.drop + msbuildVersion: 17.0 + msbuildArchitecture: x64 + - task: PowerShell@2 + displayName: List drop files + inputs: + targetType: inline + script: | + Get-ChildItem ".drop" -Recurse | select FullName + + - task: onefuzz-task@0 + displayName: 'Submit to OneFuzz' + inputs: + onefuzzOSes: 'Windows' + env: + onefuzzDropDirectory: $(Build.SourcesDirectory)\.drop + SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/.azuredevops/pipelines/DirectXTK-OneFuzz.yml b/.azuredevops/pipelines/DirectXTK-OneFuzz.yml index 00a86f3f2..0ff789362 100644 --- a/.azuredevops/pipelines/DirectXTK-OneFuzz.yml +++ b/.azuredevops/pipelines/DirectXTK-OneFuzz.yml @@ -3,7 +3,7 @@ # # https://go.microsoft.com/fwlink/?LinkId=248929 -# Builds the library using CMake and submit for file fuzzing +# Builds the library using CMake and submit for file fuzzing for texture loading schedules: - cron: "0 11 1 * *" @@ -39,7 +39,7 @@ pool: jobs: - job: FUZZ_BUILD - displayName: 'Build for file fuzzing' + displayName: 'Build for file fuzzing (DDS)' steps: - checkout: self clean: true @@ -56,7 +56,10 @@ jobs: displayName: 'CMake (MSVC): Config with ASan' inputs: cwd: $(Build.SourcesDirectory) - cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) -DBUILD_TOOLS=OFF -DBUILD_XAUDIO_WIN10=ON -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF' + cmakeArgs: > + -G "$(VS_GENERATOR)" -A x64 -B out + -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) + -DBUILD_TOOLS=OFF -DBUILD_XAUDIO_WIN10=ON -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF - task: CMake@1 displayName: 'CMake (MSVC): Build with ASan' inputs: @@ -101,21 +104,6 @@ jobs: Invoke-WebRequest -Uri $url -OutFile $target } - - task: CopyFiles@2 - displayName: Copy audio seed files - inputs: - Contents: | - Tests\BasicAudioTest\Alarm01.wav - Tests\BasicAudioTest\Alarm01_adpcm.wav - Tests\BasicAudioTest\Alarm01_float.wav - Tests\BasicAudioTest\Alarm01_xwma.wav - Tests\BasicAudioTest\ADPCMdroid.xwb - Tests\BasicAudioTest\wavebank.xwb - Tests\BasicAudioTest\xwmadroid.xwb - TargetFolder: .drop\seeds - OverWrite: true - flattenFolders: true - - task: PowerShell@2 displayName: Copy OneFuzz setup script inputs: From 691edbeed22c725143c809a028535944a364789d Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 13 May 2025 17:39:30 -0700 Subject: [PATCH 2/2] Code review --- .azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml b/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml index b14538cc9..bb77a2f71 100644 --- a/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml +++ b/.azuredevops/pipelines/DirectXTK-OneFuzz-Meshes.yml @@ -60,6 +60,7 @@ jobs: -G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) -DBUILD_TOOLS=OFF -DBUILD_XAUDIO_WIN10=ON -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF + -DBUILD_MESH_FUZZING=ON - task: CMake@1 displayName: 'CMake (MSVC): Build with ASan' inputs: