Skip to content

Commit

Permalink
Merge branch 'main' into user/maige/wfpDiag
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-Jowett authored Nov 21, 2024
2 parents 04fa0f4 + cb3833e commit ba5db1a
Show file tree
Hide file tree
Showing 1,550 changed files with 5,447 additions and 1,134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/netperf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nuget_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
steps:
# Check out the main repo.
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ossar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down Expand Up @@ -81,6 +81,6 @@ jobs:

- name: Upload results to Security tab
if: steps.skip_check.outputs.should_skip != 'true'
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
2 changes: 1 addition & 1 deletion .github/workflows/release-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
issues: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down Expand Up @@ -135,12 +135,14 @@ jobs:
- name: Initialize CodeQL
if: inputs.build_codeql == true && steps.skip_check.outputs.should_skip != 'true'
uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
with:
languages: 'cpp'

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
with:
msbuild-architecture: x64

- name: Add Visual Studio LLVM to path
if: steps.skip_check.outputs.should_skip != 'true'
Expand Down Expand Up @@ -183,7 +185,7 @@ jobs:
- name: Build
if: steps.skip_check.outputs.should_skip != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.BUILD_OPTIONS}} ${{env.SOLUTION_FILE_PATH}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.BUILD_OPTIONS}} ${{env.SOLUTION_FILE_PATH}} /bl:out.binlog

- name: Check DLL dependencies for distributed binaries
if: steps.skip_check.outputs.should_skip != 'true' && ((inputs.build_artifact == 'Build-x64' && matrix.configurations == 'Debug') || (inputs.build_artifact == 'Build-x64-native-only' && matrix.configurations == 'NativeOnlyRelease'))
Expand Down Expand Up @@ -253,7 +255,7 @@ jobs:
- name: Build the NuGet package
if: inputs.build_nuget == true && (matrix.configurations == 'Release' || matrix.configurations == 'NativeOnlyRelease') && steps.skip_check.outputs.should_skip != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}} ${{env.BUILD_OPTIONS}} /t:tools\nuget
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}} ${{env.BUILD_OPTIONS}} /t:tools\nuget /bl:out.binlog

- name: Upload the NuGet package
if: inputs.build_nuget == true && (matrix.configurations == 'Release' || matrix.configurations == 'NativeOnlyRelease') && steps.skip_check.outputs.should_skip != 'true'
Expand All @@ -265,7 +267,7 @@ jobs:
- name: Build the NuGet Redist package
if: inputs.build_nuget == true && (matrix.configurations == 'Release' || matrix.configurations == 'NativeOnlyRelease') && steps.skip_check.outputs.should_skip != 'true'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}} ${{env.BUILD_OPTIONS}} /t:tools\redist-package
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}} ${{env.BUILD_OPTIONS}} /t:tools\redist-package /bl:out.binlog

- name: Upload the NuGet Redist package
if: inputs.build_nuget == true && (matrix.configurations == 'Release' || matrix.configurations == 'NativeOnlyRelease') && steps.skip_check.outputs.should_skip != 'true'
Expand All @@ -274,6 +276,13 @@ jobs:
name: ebpf-for-windows - NuGet Redist package (${{inputs.build_artifact}}_${{env.BUILD_CONFIGURATION}})
path: ${{github.workspace}}/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}/eBPF-for-Windows-Redist.*.nupkg

- name: Upload binlog
if: (success() || failure()) && steps.skip_check.outputs.should_skip != 'true'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: build-binlog-${{env.BUILD_ARTIFACT_NAME}}-${{env.BUILD_PLATFORM}}-${{env.BUILD_CONFIGURATION}}
path: out.binlog

- name: Check for crash dumps
# Check for crash dumps even if the workflow failed.
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true')
Expand All @@ -294,4 +303,4 @@ jobs:

- name: Perform CodeQL Analysis
if: inputs.build_codeql == true && steps.skip_check.outputs.should_skip != 'true'
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
12 changes: 6 additions & 6 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:

- name: Upload Report to Codecov attempt 1
if: (steps.skip_check.outputs.should_skip != 'true') && (steps.check_coverage.outputs.files_exists == 'true')
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a
id: upload_code_coverage_report_1
continue-on-error: true
with:
Expand All @@ -336,7 +336,7 @@ jobs:

- name: Upload Report to Codecov attempt 2
if: (steps.skip_check.outputs.should_skip != 'true') && (steps.upload_code_coverage_report_1.outcome == 'failure')
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a
id: upload_code_coverage_report_2
continue-on-error: true
with:
Expand All @@ -351,7 +351,7 @@ jobs:

- name: Upload Report to Codecov attempt 3
if: (steps.skip_check.outputs.should_skip != 'true') && (steps.upload_code_coverage_report_2.outcome == 'failure')
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a
id: upload_code_coverage_report_3
continue-on-error: true
with:
Expand All @@ -366,7 +366,7 @@ jobs:

- name: Upload Report to Codecov attempt 4
if: (steps.skip_check.outputs.should_skip != 'true') && (steps.upload_code_coverage_report_3.outcome == 'failure')
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a
id: upload_code_coverage_report_4
continue-on-error: true
with:
Expand Down Expand Up @@ -463,7 +463,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
Expand Down Expand Up @@ -76,6 +76,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
if: github.ref_name == 'main'
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:

- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f
with:
egress-policy: block
allowed-endpoints: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-perf-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**/[Pp]kg/**
/**/[Pp]ackages/**
/**/[Bb]uild/**
/**/build_fuzzer/**
/**/.[Gg]radle/**
/**/[Rr]elease/**
/**/[Dd]ebug/**
Expand Down
77 changes: 77 additions & 0 deletions .onefuzz/OneFuzzConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,83 @@
}
}
}
},
{
"JobNotificationEmail": "[email protected]",
"Skip": false,
"TargetBuildBranches": [
"main"
],
"Fuzzer": {
"$type": "libfuzzer",
"FuzzingHarnessExecutableName": "ubpf_fuzzer.exe",
"CheckFuzzerHelp": true,
"FuzzingEntrypoint": "LLVMFuzzerTestOneInput",
"CollectCrashDumps": true,
"FuzzingTargetBinaries": [
"ebpapi.sys"
]
},
"MinAvailableMemoryMB": null,
"FuzzerTimeoutInSeconds": 120,
"RebootAfterSetup": null,
"Tags": {},
"TargetEnv": {
"ASAN_OPTIONS": "allocator_may_return_null=1",
"UBPF_FUZZER_CONSTRAINT_CHECK": "1"
},
"OneFuzzJobs": [
{
"ProjectName": "eBPF for Windows",
"TargetName": "ubpf",
"SeedCorpusContainer": "ubpf-corpus",
"Tags": {},
"TargetEnv": {
"ASAN_OPTIONS": "allocator_may_return_null=1"
}
}
],
"JobDependencies": [
"ubpf_fuzzer.exe",
"ubpf_fuzzer.pdb",
"clang_rt.asan_dbg_dynamic-x86_64.dll",
"clang_rt.asan_dynamic-x86_64.dll",
"msvcp140d.dll",
"msvcp140d_atomic_wait.dll",
"msvcp140d_codecvt_ids.dll",
"msvcp140_1d.dll",
"msvcp140_2d.dll",
"vccorlib140d.dll",
"vcruntime140d.dll",
"vcruntime140_1d.dll",
"vcruntime140_threadsd.dll",
"ucrtbased.dll"
],
"CodeCoverage": {
"Org": "microsoft",
"Project": "OS",
"PipelineId": "79576"
},
"AdoTemplate": {
"Org": "mscodehub",
"Project": "eBPFForWindows",
"AssignedTo": "[email protected]",
"AreaPath": "eBPFForWindows",
"IterationPath": "eBPFForWindows",
"Type": "Bug",
"BaseUrl": "https://dev.azure.com/mscodehub",
"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>",
"OnDuplicate": {
"Increment": [
""
],
"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>",
"SetState": {
"Resolved": "Active",
"Closed": "Active"
}
}
}
}
]
}
22 changes: 11 additions & 11 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
<PropertyGroup Label="Version">
<EbpfVersion_Major>0</EbpfVersion_Major>
<EbpfVersion_Minor>20</EbpfVersion_Minor>
<EbpfVersion_Minor>21</EbpfVersion_Minor>
<EbpfVersion_Revision>0</EbpfVersion_Revision>
<EbpfVersion>$(EbpfVersion_Major).$(EbpfVersion_Minor).$(EbpfVersion_Revision)</EbpfVersion>
</PropertyGroup>
Expand Down Expand Up @@ -71,13 +71,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' Or '$(Configuration)|$(Platform)'=='FuzzerDebug|x64' Or '$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">
<FuzzerLibs>libsancov.lib;clang_rt.fuzzer_MDd-x86_64.lib</FuzzerLibs>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Fuzzer)'=='Release|True'">
<PropertyGroup Condition="'$(Fuzzer)'=='True' OR '$(Configuration)'=='FuzzerDebug'">
<EnableASAN>true</EnableASAN>
<AdditionalOptions>/fsanitize-coverage=inline-bool-flag /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Fuzzer)'=='Debug|True' Or '$(Configuration)'=='FuzzerDebug'">
<EnableASAN>true</EnableASAN>
<AdditionalOptions>/fsanitize-coverage=inline-bool-flag /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
<EnableFuzzer>true</EnableFuzzer>
<FuzzerLibs>libsancov.lib;clang_rt.fuzzer_MDd-x86_64.lib</FuzzerLibs>
<ClCompile>
<AdditionalOptions>/fsanitize-coverage=inline-bool-flag /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div /DFUZZER_BUILD %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</PropertyGroup>
<PropertyGroup Condition="'$(Fuzzer)'!='True' And '$(Configuration)'!='FuzzerDebug'">
<SpectreMitigation>Spectre</SpectreMitigation>
Expand All @@ -97,7 +97,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<ControlFlowGuard>Guard</ControlFlowGuard>
<AdditionalOptions>/ZH:SHA_256 /we4062 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>$(WindowsSdkDir)Include\10.0.22621.0\km;$(SolutionDir)external\ebpf-verifier\build\packages\boost\lib\native\include;$(OutDir)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(WdkContentRoot)\Include\10.0.26100.0\km;$(SolutionDir)external\ebpf-verifier\build\packages\boost\lib\native\include;$(OutDir)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<CETCompat Condition="'$(Platform)'=='x64'">true</CETCompat>
Expand Down Expand Up @@ -142,18 +142,18 @@
</ItemGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<ClCompile>
<PreprocessorDefinitions>_AMD64_;_WIN32_WINNT=0x0a00;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_AMD64_;_WIN32_WINNT=0x0a00;_WINDLL;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<ClCompile>
<PreprocessorDefinitions>_X86_;_WIN32_WINNT=0x0a00;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_X86_;_WIN32_WINNT=0x0a00;_WINDLL;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM64'">
<ClCompile>
<!-- Set the _ARM64_ as it is required by winnt.h for correct compilation rather than the standard _M_ARM64 -->
<PreprocessorDefinitions>_ARM64_;_WIN32_WINNT=0x0a00;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_ARM64_;_WIN32_WINNT=0x0a00;_WINDLL;_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Set the option to emit both armv8.0 atomics and armv8.1 atomics with processor detection to select the best performing one.-->
<AdditionalOptions>/d2overrideInterlockedIntrinsArm64 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
Expand Down
5 changes: 0 additions & 5 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ The following must be installed in order to build this project:
> Note: The *WiX Toolset* has a dependency on the **.NET 3.5 Framework**: you can either enable from the Start menu -> "*Turn Windows features on or off*" and then select "*.NET Framework 3.5 (includes .NET 2.0 and 3.0)*" (recommended), *or*
install it directly from [here](https://www.microsoft.com/en-us/download/details.aspx?id=21).
1. [WiX Toolset v3 - Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension).
1. [SDK for Windows 11, version 22H2](https://go.microsoft.com/fwlink/p/?linkid=2196241) (version **10.0.22621.x**).
1. [WDK for Windows 11, version 22H2](https://go.microsoft.com/fwlink/?linkid=2196230) (version **10.0.22621.x**), including the
"*Windows Driver Kit Visual Studio extension*" (make sure the "*Install Windows Driver Kit Visual Studio Extension*"
check box is checked before completing the installer).
>Note: as multiple versions of WDKs cannot coexist side-by-side, you may be asked to uninstall previous versions.
1. [NuGet Windows x86 Commandline](https://www.nuget.org/downloads) (version **6.3.1 or higher**), which can be installed to a location
such as "C:\Program Files (x86)\NuGet\".

Expand Down
Loading

0 comments on commit ba5db1a

Please sign in to comment.