Compare commits
40 commits
main
...
dev/cazamo
Author | SHA1 | Date | |
---|---|---|---|
1a2da08f15 | |||
158d242d85 | |||
e15f639b85 | |||
d8d0cc90d0 | |||
d5c7cebc7d | |||
83037289ef | |||
ce5209880f | |||
c97787f020 | |||
4bd309522d | |||
541b25c68f | |||
c32524ae1f | |||
a578d877c1 | |||
1268cc1493 | |||
16d226a6f4 | |||
c91e078df8 | |||
4e3a1ba8e9 | |||
a8c905d95f | |||
83ea5f3a68 | |||
7719b1feeb | |||
1030c062cf | |||
35c99673cf | |||
facdf7745c | |||
dc9fd554c4 | |||
153971af7d | |||
db0fdd6ba9 | |||
745728a082 | |||
7611c6cf02 | |||
74bcb1c6b8 | |||
aa644e94c9 | |||
ce26d64ee7 | |||
02af781697 | |||
bda579ddfb | |||
e3f64b943c | |||
d4ae5f9a28 | |||
da864edf53 | |||
e8266b13b9 | |||
f2f188fd70 | |||
6e6a6edfa3 | |||
284a4a7e82 | |||
f39b092a5e |
4
.github/actions/spelling/allow/allow.txt
vendored
4
.github/actions/spelling/allow/allow.txt
vendored
|
@ -3,6 +3,7 @@ apc
|
||||||
Apc
|
Apc
|
||||||
bsd
|
bsd
|
||||||
calt
|
calt
|
||||||
|
CMMI
|
||||||
ccmp
|
ccmp
|
||||||
changelog
|
changelog
|
||||||
clickable
|
clickable
|
||||||
|
@ -35,6 +36,7 @@ img
|
||||||
inlined
|
inlined
|
||||||
It'd
|
It'd
|
||||||
kje
|
kje
|
||||||
|
libfuzzer
|
||||||
liga
|
liga
|
||||||
lje
|
lje
|
||||||
Llast
|
Llast
|
||||||
|
@ -46,11 +48,13 @@ maxed
|
||||||
mkmk
|
mkmk
|
||||||
mnt
|
mnt
|
||||||
mru
|
mru
|
||||||
|
noreply
|
||||||
nje
|
nje
|
||||||
noreply
|
noreply
|
||||||
ogonek
|
ogonek
|
||||||
ok'd
|
ok'd
|
||||||
overlined
|
overlined
|
||||||
|
pipeline
|
||||||
postmodern
|
postmodern
|
||||||
ptys
|
ptys
|
||||||
qof
|
qof
|
||||||
|
|
2
.github/actions/spelling/allow/apis.txt
vendored
2
.github/actions/spelling/allow/apis.txt
vendored
|
@ -30,6 +30,7 @@ DERR
|
||||||
dlldata
|
dlldata
|
||||||
DONTADDTORECENT
|
DONTADDTORECENT
|
||||||
DWORDLONG
|
DWORDLONG
|
||||||
|
endfor
|
||||||
enumset
|
enumset
|
||||||
environstrings
|
environstrings
|
||||||
EXPCMDFLAGS
|
EXPCMDFLAGS
|
||||||
|
@ -115,6 +116,7 @@ oaidl
|
||||||
ocidl
|
ocidl
|
||||||
ODR
|
ODR
|
||||||
offsetof
|
offsetof
|
||||||
|
onefuzz
|
||||||
osver
|
osver
|
||||||
OSVERSIONINFOEXW
|
OSVERSIONINFOEXW
|
||||||
otms
|
otms
|
||||||
|
|
1
.github/actions/spelling/allow/microsoft.txt
vendored
1
.github/actions/spelling/allow/microsoft.txt
vendored
|
@ -39,6 +39,7 @@ MSVC
|
||||||
muxc
|
muxc
|
||||||
netcore
|
netcore
|
||||||
osgvsowi
|
osgvsowi
|
||||||
|
Onefuzz
|
||||||
PFILETIME
|
PFILETIME
|
||||||
pgc
|
pgc
|
||||||
pgo
|
pgo
|
||||||
|
|
2
.github/actions/spelling/allow/names.txt
vendored
2
.github/actions/spelling/allow/names.txt
vendored
|
@ -8,6 +8,7 @@ dhowett
|
||||||
Diviness
|
Diviness
|
||||||
dsafa
|
dsafa
|
||||||
duhowett
|
duhowett
|
||||||
|
DXP
|
||||||
ekg
|
ekg
|
||||||
eryksun
|
eryksun
|
||||||
ethanschoonover
|
ethanschoonover
|
||||||
|
@ -69,6 +70,7 @@ sonpham
|
||||||
stakx
|
stakx
|
||||||
thereses
|
thereses
|
||||||
Walisch
|
Walisch
|
||||||
|
WDX
|
||||||
Wellons
|
Wellons
|
||||||
Wirt
|
Wirt
|
||||||
Wojciech
|
Wojciech
|
||||||
|
|
1
.github/actions/spelling/expect/web.txt
vendored
1
.github/actions/spelling/expect/web.txt
vendored
|
@ -17,3 +17,4 @@ mdtauk
|
||||||
cppreference
|
cppreference
|
||||||
gfycat
|
gfycat
|
||||||
Guake
|
Guake
|
||||||
|
azurewebsites
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
|
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
|
||||||
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||||
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
|
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
|
||||||
|
"Microsoft.VisualStudio.Component.VC.ASAN",
|
||||||
"Microsoft.VisualStudio.Component.VC.v142.x86.x64",
|
"Microsoft.VisualStudio.Component.VC.v142.x86.x64",
|
||||||
"Microsoft.VisualStudio.Component.VC.v142.ARM64",
|
"Microsoft.VisualStudio.Component.VC.v142.ARM64",
|
||||||
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
|
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
|
||||||
|
|
|
@ -1198,11 +1198,11 @@ Global
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Debug|x86.Build.0 = Debug|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Debug|x86.Build.0 = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|Any CPU.ActiveCfg = Debug|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|Any CPU.ActiveCfg = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM.ActiveCfg = Debug|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM.ActiveCfg = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|ARM64.ActiveCfg = Debug|ARM64
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x64Test.ActiveCfg = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x86Test.ActiveCfg = Debug|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|DotNet_x86Test.ActiveCfg = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x64.ActiveCfg = Debug|x64
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x64.ActiveCfg = Debug|x64
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Fuzzing|x86.ActiveCfg = Debug|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|Any CPU.ActiveCfg = Release|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM.ActiveCfg = Release|Win32
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM.ActiveCfg = Release|Win32
|
||||||
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM64.ActiveCfg = Release|ARM64
|
{099193A0-1E43-4BBC-BA7F-7B351E1342DF}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
@ -1269,7 +1269,6 @@ Global
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|Any CPU.ActiveCfg = Release|Win32
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|ARM.ActiveCfg = Release|Win32
|
{919544AC-D39B-463F-8414-3C3C67CF727C}.Release|ARM.ActiveCfg = Release|Win32
|
||||||
|
@ -3246,13 +3245,10 @@ Global
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|ARM64.Build.0 = Fuzzing|ARM64
|
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Fuzzing|x86.Build.0 = Fuzzing|Win32
|
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|Any CPU.ActiveCfg = Release|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM.ActiveCfg = Release|Win32
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM.ActiveCfg = Release|Win32
|
||||||
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM64.ActiveCfg = Release|ARM64
|
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
@ -3326,7 +3322,6 @@ Global
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x64.Build.0 = Fuzzing|x64
|
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.Build.0 = Fuzzing|Win32
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Fuzzing|x86.Build.0 = Fuzzing|Win32
|
||||||
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Release|Any CPU.ActiveCfg = Release|Win32
|
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
|
|
34
build/Fuzz/notifications-ado.json
Normal file
34
build/Fuzz/notifications-ado.json
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"config": {
|
||||||
|
"base_url": "https://dev.azure.com/microsoft/os",
|
||||||
|
"auth_token": "INSERT_PAT_HERE",
|
||||||
|
"project": "OpenConsole",
|
||||||
|
"type": "Bug",
|
||||||
|
"unique_fields": [
|
||||||
|
"Microsoft.VSTS.Common.CustomString03"
|
||||||
|
],
|
||||||
|
"comment": "<a href='{{ input_url }}'>This input</a> caused the <a href='{{ target_url }}'>fuzz target</a> {{ report.executable }} to crash. The faulting input SHA256 hash is {{ report.input_sha256 }} <br>",
|
||||||
|
"ado_fields": {
|
||||||
|
"System.AssignedTo": "INSERT_ASSIGNED_HERE",
|
||||||
|
"System.Tags": "OneFuzz",
|
||||||
|
"System.AreaPath": "OS\\WDX\\DXP\\WinDev\\Terminal",
|
||||||
|
"OSG.Watson.Telemetry14DaysInMarketHits": "1",
|
||||||
|
"System.IterationPath": "OS\\Future",
|
||||||
|
"Microsoft.VSTS.Common.CustomString01": "{{ job.project }}",
|
||||||
|
"Microsoft.VSTS.Common.CustomString02": "{{ job.name }}",
|
||||||
|
"Microsoft.VSTS.Common.CustomString03": "{{ report.minimized_stack_function_lines_sha256}}",
|
||||||
|
"System.Title": "[Fuzzing] - {{ report.crash_site }}",
|
||||||
|
"Microsoft.VSTS.CMMI.HowFound": "Security: Fuzzing",
|
||||||
|
"OSG.SecurityImpact": "Security Triage Requested",
|
||||||
|
"OSG.SDLSeverity": "Moderate",
|
||||||
|
"Microsoft.VSTS.TCM.ReproSteps": "The fuzzing target ({{ job.project }} {{ job.name }} {{ job.build }}) reported a crash. <br> {%if report.asan_log %} AddressSanitizer reported the following details: <br> <pre> {{ report.asan_log }} </pre> {% else %} Faulting call stack: <ul> {% for item in report.call_stack %} <li> {{ item }} </li> {% endfor %} </ul> <br> {% endif %} You can reproduce the issue remotely in OneFuzz by running the following command: <pre> {{ repro_cmd }} </pre>"
|
||||||
|
},
|
||||||
|
"on_duplicate": {
|
||||||
|
"set_state": {"Resolved": "Active", "Closed": "Active"},
|
||||||
|
"ado_fields": {
|
||||||
|
"System.IterationPath": "OS\\Future"
|
||||||
|
},
|
||||||
|
"increment": ["OSG.Watson.Telemetry14DaysInMarketHits"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
61
build/pipelines/fuzz.yml
Normal file
61
build/pipelines/fuzz.yml
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
trigger:
|
||||||
|
batch: true
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
exclude:
|
||||||
|
- docs/*
|
||||||
|
- samples/*
|
||||||
|
- tools/*
|
||||||
|
|
||||||
|
pr: none
|
||||||
|
|
||||||
|
# 0.0.yyMM.dd##
|
||||||
|
# 0.0.1904.0900
|
||||||
|
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Build_Fuzz_Config
|
||||||
|
displayName: Build Fuzzers
|
||||||
|
dependsOn: []
|
||||||
|
condition: succeeded()
|
||||||
|
jobs:
|
||||||
|
- template: ./templates/build-console-fuzzing.yml
|
||||||
|
parameters:
|
||||||
|
platform: x64
|
||||||
|
- stage: OneFuzz
|
||||||
|
displayName: Submit OneFuzz Job
|
||||||
|
dependsOn: ['Build_Fuzz_Config']
|
||||||
|
condition: succeeded()
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-latest'
|
||||||
|
variables:
|
||||||
|
artifactName: drop
|
||||||
|
jobs:
|
||||||
|
- job:
|
||||||
|
steps:
|
||||||
|
- task: DownloadBuildArtifacts@0
|
||||||
|
inputs:
|
||||||
|
artifactName: $(artifactName)
|
||||||
|
downloadPath: $(Build.ArtifactStagingDirectory)
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '3.x'
|
||||||
|
addToPath: true
|
||||||
|
architecture: 'x64'
|
||||||
|
- bash: |
|
||||||
|
set -ex
|
||||||
|
pip -q install onefuzz
|
||||||
|
onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain) --client_secret $(client_secret)
|
||||||
|
sed -i s/INSERT_PAT_HERE/${ado_pat}/ build/Fuzz/notifications-ado.json
|
||||||
|
sed -i s/INSERT_ASSIGNED_HERE/${ado_assigned_to}/ build/Fuzz/notifications-ado.json
|
||||||
|
displayName: Configure OneFuzz
|
||||||
|
# replace the bash command below with this to run this with notifications
|
||||||
|
# onefuzz template libfuzzer basic --colocate_all_tasks --vm_count 1 --target_exe $target_exe_path --notification_config build/Fuzz/notifications-ado.json OpenConsole $test_name $(Build.SourceVersion) windows
|
||||||
|
- bash: |
|
||||||
|
onefuzz template libfuzzer basic --colocate_all_tasks --vm_count 1 --target_exe $target_exe_path OpenConsole $test_name $(Build.SourceVersion) windows
|
||||||
|
displayName: Submit OneFuzz Job
|
||||||
|
env:
|
||||||
|
target_exe_path: $(Build.ArtifactStagingDirectory)/$(artifactName)/Fuzzing/x64/test/OpenConsoleFuzzer.exe
|
||||||
|
test_name: WriteCharsLegacy
|
132
build/pipelines/templates/build-console-fuzzing.yml
Normal file
132
build/pipelines/templates/build-console-fuzzing.yml
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
parameters:
|
||||||
|
configuration: 'Fuzzing'
|
||||||
|
platform: ''
|
||||||
|
additionalBuildArguments: ''
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||||
|
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||||
|
variables:
|
||||||
|
BuildConfiguration: ${{ parameters.configuration }}
|
||||||
|
BuildPlatform: ${{ parameters.platform }}
|
||||||
|
pool:
|
||||||
|
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
|
name: WinDevPoolOSS-L
|
||||||
|
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||||
|
name: WinDevPool-L
|
||||||
|
demands: ImageOverride -equals WinDevVS16-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
submodules: true
|
||||||
|
clean: true
|
||||||
|
|
||||||
|
- task: NuGetToolInstaller@0
|
||||||
|
displayName: 'Use NuGet 5.2.0'
|
||||||
|
inputs:
|
||||||
|
versionSpec: 5.2.0
|
||||||
|
|
||||||
|
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||||
|
# This should be `task: NuGetCommand@2`
|
||||||
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||||
|
displayName: Restore NuGet packages for solution
|
||||||
|
inputs:
|
||||||
|
command: restore
|
||||||
|
feedsToUse: config
|
||||||
|
configPath: NuGet.config
|
||||||
|
restoreSolution: OpenConsole.sln
|
||||||
|
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||||
|
|
||||||
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||||
|
displayName: Restore NuGet packages for extraneous build actions
|
||||||
|
inputs:
|
||||||
|
command: restore
|
||||||
|
feedsToUse: config
|
||||||
|
configPath: NuGet.config
|
||||||
|
restoreSolution: build/packages.config
|
||||||
|
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||||
|
|
||||||
|
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||||
|
- script: |
|
||||||
|
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||||
|
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||||
|
del %TEMP%\vsinstalldir.txt
|
||||||
|
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||||
|
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||||
|
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||||
|
displayName: 'Retrieve VC tools directory'
|
||||||
|
|
||||||
|
- task: CmdLine@1
|
||||||
|
displayName: 'Display build machine environment variables'
|
||||||
|
inputs:
|
||||||
|
filename: 'set'
|
||||||
|
|
||||||
|
- task: VSBuild@1
|
||||||
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
|
inputs:
|
||||||
|
solution: '**\OpenConsole.sln'
|
||||||
|
vsVersion: 16.0
|
||||||
|
platform: '$(BuildPlatform)'
|
||||||
|
configuration: '$(BuildConfiguration)'
|
||||||
|
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
||||||
|
clean: true
|
||||||
|
maximumCpuCount: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: 'Rationalize build platform'
|
||||||
|
inputs:
|
||||||
|
targetType: inline
|
||||||
|
script: |
|
||||||
|
$Arch = "$(BuildPlatform)"
|
||||||
|
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||||
|
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
displayName: 'Copy result logs to Artifacts'
|
||||||
|
inputs:
|
||||||
|
Contents: |
|
||||||
|
**/*.wtl
|
||||||
|
**/*onBuildMachineResults.xml
|
||||||
|
${{ parameters.testLogPath }}
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||||
|
OverWrite: true
|
||||||
|
flattenFolders: true
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
displayName: 'Copy *.appx/*.msix to Artifacts (Non-PR builds only)'
|
||||||
|
inputs:
|
||||||
|
Contents: |
|
||||||
|
**/*.appx
|
||||||
|
**/*.msix
|
||||||
|
**/*.appxsym
|
||||||
|
!**/Microsoft.VCLibs*.appx
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/appx'
|
||||||
|
OverWrite: true
|
||||||
|
flattenFolders: true
|
||||||
|
condition: succeeded()
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
displayName: 'Copy outputs needed for test runs to Artifacts'
|
||||||
|
inputs:
|
||||||
|
Contents: |
|
||||||
|
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.exe
|
||||||
|
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.dll
|
||||||
|
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.xml
|
||||||
|
**/Microsoft.VCLibs.*.appx
|
||||||
|
**/TestHostApp/*.exe
|
||||||
|
**/TestHostApp/*.dll
|
||||||
|
**/TestHostApp/*.xml
|
||||||
|
!**/*.pdb
|
||||||
|
!**/*.ipdb
|
||||||
|
!**/*.obj
|
||||||
|
!**/*.pch
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||||
|
OverWrite: true
|
||||||
|
flattenFolders: true
|
||||||
|
condition: succeeded()
|
||||||
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
displayName: 'Publish All Build Artifacts'
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
ArtifactName: 'drop'
|
|
@ -113,7 +113,7 @@ steps:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: build\scripts\Run-Tests.ps1
|
filePath: build\scripts\Run-Tests.ps1
|
||||||
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
||||||
condition: and(and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument')), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
condition: and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument'), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Run Feature Tests (x64 only)'
|
displayName: 'Run Feature Tests (x64 only)'
|
||||||
|
@ -121,7 +121,7 @@ steps:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: build\scripts\Run-Tests.ps1
|
filePath: build\scripts\Run-Tests.ps1
|
||||||
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}'
|
||||||
condition: and(and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument')), eq(variables['BuildPlatform'], 'x64'))
|
condition: and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument'), eq(variables['BuildPlatform'], 'x64'))
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Convert Test Logs from WTL to xUnit format'
|
displayName: 'Convert Test Logs from WTL to xUnit format'
|
||||||
|
@ -129,7 +129,7 @@ steps:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: build\Helix\ConvertWttLogToXUnit.ps1
|
filePath: build\Helix\ConvertWttLogToXUnit.ps1
|
||||||
arguments: -WttInputPath '${{ parameters.testLogPath }}' -WttSingleRerunInputPath 'unused.wtl' -WttMultipleRerunInputPath 'unused2.wtl' -XUnitOutputPath 'onBuildMachineResults.xml' -TestNamePrefix '$(BuildConfiguration).$(BuildPlatform)'
|
arguments: -WttInputPath '${{ parameters.testLogPath }}' -WttSingleRerunInputPath 'unused.wtl' -WttMultipleRerunInputPath 'unused2.wtl' -XUnitOutputPath 'onBuildMachineResults.xml' -TestNamePrefix '$(BuildConfiguration).$(BuildPlatform)'
|
||||||
condition: and(ne(variables['PGOBuildMode'], 'Instrument'),or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
condition: and(ne(variables['PGOBuildMode'], 'Instrument'), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
displayName: 'Upload converted test logs'
|
displayName: 'Upload converted test logs'
|
||||||
|
@ -193,7 +193,7 @@ steps:
|
||||||
displayName: 'Publish All Build Artifacts'
|
displayName: 'Publish All Build Artifacts'
|
||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||||
ArtifactName: 'drop'
|
ArtifactName: 'drop'
|
||||||
|
|
||||||
- task: CopyFiles@2
|
- task: CopyFiles@2
|
||||||
displayName: 'Copy PGO databases needed for PGO instrumentation run'
|
displayName: 'Copy PGO databases needed for PGO instrumentation run'
|
||||||
|
|
62
doc/fuzzing.md
Normal file
62
doc/fuzzing.md
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
# Fuzzing
|
||||||
|
|
||||||
|
## Setting up a fuzzer locally
|
||||||
|
|
||||||
|
As of v1.8, OpenConsole can now be built with a `Fuzzing` configuration.
|
||||||
|
|
||||||
|
To set up a fuzzer, you'll need an `LLVMFuzzerTestOneInput` function. This serves as a way for the fuzzer to attach itself and inject tests into your fuzz target.
|
||||||
|
|
||||||
|
To build the fuzzer locally, build the OpenConsole solution in the `Fuzzing` configuration. This should output an executable that runs the fuzzer on the provided test case. In the case of PR \#9604, the desired executable is located at `bin\x64\Fuzzing\OpenConsoleFuzzer.exe`.
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
- [LibFuzzer Docs](https://www.llvm.org/docs/LibFuzzer.html)
|
||||||
|
- [#9604](https://github.com/microsoft/terminal/pull/9604)
|
||||||
|
|
||||||
|
## Setting up OneFuzz
|
||||||
|
|
||||||
|
OneFuzz allows us to run our fuzzers in CI and be alerted of new bugs found in this endeavor.
|
||||||
|
|
||||||
|
### Installing OneFuzz
|
||||||
|
|
||||||
|
You can download the latest OneFuzz CLI on their [releases page](https://github.com/microsoft/onefuzz/releases).
|
||||||
|
|
||||||
|
### Configuring OneFuzz
|
||||||
|
|
||||||
|
To run OneFuzz locally, you'll need to configure its endpoint, client ID, and client secret. Windows has a preset configuration available; this can be found at [this tutorial](https://www.osgwiki.com/wiki/Fuzzing_Service_-_Azure_Edge_and_Platform#Configure_OneFuzz_CLI) on osgwiki.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
`onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain)`
|
||||||
|
|
||||||
|
**NOTE**: Our pipeline is already set up with these variables, so you don't need to worry about this when running this on Azure DevOps.
|
||||||
|
|
||||||
|
### Running a job on OneFuzz
|
||||||
|
|
||||||
|
You should now be able to run a job using the following command:
|
||||||
|
|
||||||
|
`onefuzz template libfuzzer basic <project> <name> <build> <pool> --target_exe <exe_path>`
|
||||||
|
|
||||||
|
- `project`: the name of the project
|
||||||
|
- `name`: the name of the test
|
||||||
|
- `build`: the identifier for the build (i.e. commit SHA1)
|
||||||
|
- `pool`: the VM pool to run this on
|
||||||
|
- `exe_path`: the fuzzer executable output from building your project
|
||||||
|
|
||||||
|
This should also output more information (i.e. job ID) about the newly created job in a JSON format.
|
||||||
|
|
||||||
|
### Enabling notifications
|
||||||
|
|
||||||
|
**NOTE**: Our pipeline is already set up with this functionality. However, here is a quick guide on how to get it set up and modify it to our liking.
|
||||||
|
|
||||||
|
OneFuzz supports multiple notification systems at once including MS Teams and Azure DevOps. See the resources below to learn more about setting these up.
|
||||||
|
|
||||||
|
Our pipeline has been set up to create Azure DevOps work items.
|
||||||
|
|
||||||
|
### Resources
|
||||||
|
- [OneFuzz GitHub](https://github.com/microsoft/onefuzz)
|
||||||
|
- [Getting started using OneFuzz](https://github.com/microsoft/onefuzz/blob/main/docs/getting-started.md)
|
||||||
|
- [Releases Page](https://github.com/microsoft/onefuzz/releases)
|
||||||
|
- [Notifications](https://github.com/microsoft/onefuzz/blob/main/docs/notifications.md)
|
||||||
|
- [MS Teams](https://github.com/microsoft/onefuzz/blob/main/docs/notifications/teams.md)
|
||||||
|
- [Azure DevOps](https://github.com/microsoft/onefuzz/blob/main/docs/notifications/ado.md)
|
||||||
|
- [OSG Wiki - OneFuzz](https://www.osgwiki.com/wiki/Fuzzing_Service_-_Azure_Edge_and_Platform)
|
|
@ -82,7 +82,7 @@
|
||||||
<!-- In theory, we may want to build with a normal main() when Fuzzing is not enabled. -->
|
<!-- In theory, we may want to build with a normal main() when Fuzzing is not enabled. -->
|
||||||
<!-- So, let's only add the fuzzer to the link line when we're building for Fuzzing. -->
|
<!-- So, let's only add the fuzzer to the link line when we're building for Fuzzing. -->
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>clang_rt.fuzzer-$(OCClangArchitectureName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>WinMM.Lib;clang_rt.fuzzer_MT-$(OCClangArchitectureName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
|
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<ProjectName>OpenConsoleProxy</ProjectName>
|
<ProjectName>OpenConsoleProxy</ProjectName>
|
||||||
<TargetName>OpenConsoleProxy</TargetName>
|
<TargetName>OpenConsoleProxy</TargetName>
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<ConfigurationType Condition="'$(Configuration)'=='Fuzzing'">StaticLibrary</ConfigurationType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(SolutionDir)src\common.build.pre.props" />
|
<Import Project="$(SolutionDir)src\common.build.pre.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue