forked from rlane/ubpf
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alan Jowett <[email protected]>
- Loading branch information
Alan Jowett
committed
Oct 21, 2024
1 parent
f4cd68d
commit 717919d
Showing
5 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ on: | |
workflow_call: | ||
|
||
jobs: | ||
build: | ||
posix: | ||
strategy: | ||
matrix: | ||
platform: | ||
|
@@ -98,7 +98,6 @@ jobs: | |
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DUBPF_ENABLE_LIBFUZZER=1 \ | ||
-DVERIFIER_ENABLE_TESTS=false \ | ||
${arch_flags} | ||
- name: Build uBPF | ||
|
@@ -111,7 +110,7 @@ jobs: | |
- name: Upload fuzzer as artifacts | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: fuzzer | ||
name: fuzzer-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: build/bin/ubpf_fuzzer | ||
|
||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
|
@@ -122,7 +121,7 @@ jobs: | |
- name: Download fuzzer artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | ||
with: | ||
name: fuzzer | ||
name: fuzzer-${{ matrix.platform }}-${{ matrix.arch }} | ||
|
||
- name: Setup directory for fuzzing | ||
run: | | ||
|
@@ -152,5 +151,84 @@ jobs: | |
if: always() | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: fuzzing-artifacts | ||
name: fuzzing-artifacts-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: artifacts/ | ||
|
||
windows: | ||
strategy: | ||
matrix: | ||
platform: | ||
- windows-latest | ||
arch: | ||
- x86_64 | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Configure uBPF | ||
run: | | ||
cmake -S . -B build -DUBPF_ENABLE_LIBFUZZER=1 | ||
- name: Build uBPF | ||
run: | | ||
cmake --build build --config RelWithDebInfo | ||
- name: Gather clang-rt files | ||
run: | | ||
$exePath = (Get-Command link.exe).Path | ||
$directory = Split-Path $exePath | ||
Copy-Item -Path "$directory\clang_rt*" -Destination "build/bin/RelWithDebInfo" | ||
- name: Upload fuzzer as artifacts | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: fuzzer-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: build/bin/RelWithDebInfo/ubpf_fuzzer.* | ||
|
||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
with: | ||
submodules: 'recursive' | ||
ref: fuzz/corpus | ||
|
||
- name: Download fuzzer artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | ||
with: | ||
name: fuzzer-${{ matrix.platform }}-${{ matrix.arch }} | ||
|
||
- name: Setup directory for fuzzing | ||
run: | | ||
dir | ||
md new_corpus | ||
copy fuzz\corpus\* new_corpus | ||
md artifacts | ||
- name: Run fuzzing | ||
run: | | ||
.\ubpf_fuzzer.exe new_corpus -artifact_prefix=artifacts/ -use_value_profile=1 -max_total_time=300 | ||
- name: Merge corpus into fuzz/corpus | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: | | ||
./ubpf_fuzzer -merge=1 fuzz/corpus new_corpus | ||
git add fuzz/corpus | ||
git config --global user.email '[email protected]' | ||
git config --global user.name 'Github Action' | ||
git commit -sm "Update fuzzing corpus" | ||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{github.repository}}.git | ||
git push | ||
- name: Upload artifacts | ||
if: always() | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: fuzzing-artifacts-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters