Skip to content

Commit 81f84a2

Browse files
evverxmrc0mmand
authored andcommitted
ci: use CFLite to test forks (including systemd-stable)
It's like CIFuzz but unlike CIFuzz it's compatible with forks and it should make it possible to run the fuzzers to make sure that patches backported to them are backported correctly without introducing new bugs and regressions.
1 parent aca6bad commit 81f84a2

File tree

5 files changed

+80
-1
lines changed

5 files changed

+80
-1
lines changed

.clusterfuzzlite/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM gcr.io/oss-fuzz-base/base-builder@sha256:14b332de0e18683f37386eaedbf735bc6e8d81f9c0e1138d620f2178e20cd30a
2+
COPY . $SRC/systemd
3+
WORKDIR $SRC/systemd
4+
COPY tools/oss-fuzz.sh $SRC/build.sh

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ updates:
1212
schedule:
1313
interval: "monthly"
1414
open-pull-requests-limit: 2
15+
- package-ecosystem: "docker"
16+
directory: "/.clusterfuzzlite"
17+
schedule:
18+
interval: "monthly"
19+
open-pull-requests-limit: 2

.github/workflows/cflite_build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# vi: ts=2 sw=2 et:
3+
# SPDX-License-Identifier: LGPL-2.1-or-later
4+
#
5+
name: ClusterFuzzLite continuous builds
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- v[0-9]+-stable
11+
12+
permissions: read-all
13+
14+
jobs:
15+
Build:
16+
runs-on: ubuntu-latest
17+
if: github.repository != 'systemd/systemd'
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
sanitizer: [address, undefined, memory]
25+
steps:
26+
- name: Build Fuzzers (${{ matrix.sanitizer }})
27+
id: build
28+
uses: google/clusterfuzzlite/actions/build_fuzzers@41dccd0566905e2a7d1724e7883edbfa66d78877
29+
with:
30+
sanitizer: ${{ matrix.sanitizer }}
31+
upload-build: true

.github/workflows/cflite_pr.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# vi: ts=2 sw=2 et:
3+
# SPDX-License-Identifier: LGPL-2.1-or-later
4+
#
5+
name: ClusterFuzzLite PR fuzzing
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- v[0-9]+-stable
11+
12+
permissions: read-all
13+
14+
jobs:
15+
PR:
16+
runs-on: ubuntu-latest
17+
if: github.repository != 'systemd/systemd' || github.event.pull_request.user.login == 'dependabot[bot]'
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
sanitizer: [address, undefined, memory]
25+
steps:
26+
- name: Build Fuzzers (${{ matrix.sanitizer }})
27+
id: build
28+
uses: google/clusterfuzzlite/actions/build_fuzzers@41dccd0566905e2a7d1724e7883edbfa66d78877
29+
with:
30+
sanitizer: ${{ matrix.sanitizer }}
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Run Fuzzers (${{ matrix.sanitizer }})
33+
id: run
34+
uses: google/clusterfuzzlite/actions/run_fuzzers@41dccd0566905e2a7d1724e7883edbfa66d78877
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
fuzz-seconds: 1200
38+
mode: 'code-change'
39+
sanitizer: ${{ matrix.sanitizer }}

tools/oss-fuzz.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ rm -rf "$hosts"
8080

8181
# The seed corpus is a separate flat archive for each fuzzer,
8282
# with a fixed name ${fuzzer}_seed_corpus.zip.
83-
for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do
83+
for d in test/fuzz/fuzz-*; do
8484
zip -jqr "$OUT/$(basename "$d")_seed_corpus.zip" "$d"
8585
done
8686

0 commit comments

Comments
 (0)