Repository navigation
68 lines (59 loc) · 1.93 KB
/
Copy pathfuzz.yml
File metadata and controls
68 lines (59 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Deserializer fuzz smoke
on:
pull_request:
paths:
- 'php/src/**'
- 'php/tests/fuzz/**'
- '.github/workflows/fuzz.yml'
push:
branches:
- main
- master
paths:
- 'php/src/**'
- 'php/tests/fuzz/**'
- '.github/workflows/fuzz.yml'
jobs:
fuzz-smoke:
name: AFL + ASan smoke
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: phpize, php-config
coverage: none
- name: Install build + fuzzing dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf pkg-config libssl-dev \
clang llvm afl++
- name: Build instrumented (ASan/UBSan) loader
run: |
so=$(php/tests/fuzz/build-fuzzer.sh php-config | tail -1)
echo "OPDUMP_SO=$so" >> "$GITHUB_ENV"
- name: Generate seed corpus
run: php/tests/fuzz/make-seeds.sh "$OPDUMP_SO"
- name: Short fuzz campaign (120s)
env:
AFL_SKIP_CPUFREQ: '1'
AFL_BENCH_UNTIL_CRASH: '1'
run: php/tests/fuzz/run-fuzz.sh fuzz "$OPDUMP_SO" 120
# Blocking: the known parse/teardown backlog is fixed (see
# php/tests/fuzz/README.md "Findings fixed with this harness"), so any
# crash the smoke campaign saves is a regression and fails the build.
- name: Fail if crashes were found
run: |
crashes=$(find php/tests/fuzz/findings -path '*/crashes/id:*' 2>/dev/null | wc -l)
echo "::notice::fuzz smoke saved $crashes crash input(s)"
test "$crashes" -eq 0
- name: Upload findings
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-findings
path: php/tests/fuzz/findings/
if-no-files-found: ignore