aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-01-30 18:35:28 +0000
committerGitHub <noreply@github.com>2022-01-30 18:35:28 +0000
commit15391a2245465b0e3d0d90d254d249dd242b5421 (patch)
tree425532d80e86ebd2b1fcef1e0599d5888af23d84
parentcore: check if argc > 0 and argv[0] is set (diff)
parentci: no longer upload the latest builds on commits (diff)
downloadsystemd-15391a2245465b0e3d0d90d254d249dd242b5421.tar.xz
systemd-15391a2245465b0e3d0d90d254d249dd242b5421.zip
Merge pull request #22302 from evverx/merge-oss-fuzz-corpora
ci: merge seed corpora with public OSS-Fuzz corpora on CFLite
-rw-r--r--.clusterfuzzlite/Dockerfile1
-rw-r--r--.github/workflows/cflite_build.yml31
-rwxr-xr-xtools/oss-fuzz.sh14
3 files changed, 14 insertions, 32 deletions
diff --git a/.clusterfuzzlite/Dockerfile b/.clusterfuzzlite/Dockerfile
index bdb0378ebc2..47f238c785c 100644
--- a/.clusterfuzzlite/Dockerfile
+++ b/.clusterfuzzlite/Dockerfile
@@ -1,4 +1,5 @@
FROM gcr.io/oss-fuzz-base/base-builder@sha256:14b332de0e18683f37386eaedbf735bc6e8d81f9c0e1138d620f2178e20cd30a
+ENV MERGE_WITH_OSS_FUZZ_CORPORA=yes
COPY . $SRC/systemd
WORKDIR $SRC/systemd
COPY tools/oss-fuzz.sh $SRC/build.sh
diff --git a/.github/workflows/cflite_build.yml b/.github/workflows/cflite_build.yml
deleted file mode 100644
index cfb3721a0e2..00000000000
--- a/.github/workflows/cflite_build.yml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-# vi: ts=2 sw=2 et:
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-name: ClusterFuzzLite continuous builds
-on:
- push:
- branches:
- - main
- - v[0-9]+-stable
-
-permissions: read-all
-
-jobs:
- Build:
- runs-on: ubuntu-latest
- if: github.repository != 'systemd/systemd'
- concurrency:
- group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}
- cancel-in-progress: true
- strategy:
- fail-fast: false
- matrix:
- sanitizer: [address, undefined, memory]
- steps:
- - name: Build Fuzzers (${{ matrix.sanitizer }})
- id: build
- uses: google/clusterfuzzlite/actions/build_fuzzers@41dccd0566905e2a7d1724e7883edbfa66d78877
- with:
- sanitizer: ${{ matrix.sanitizer }}
- upload-build: true
diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh
index f227eb0e85c..8ff3abefb74 100755
--- a/tools/oss-fuzz.sh
+++ b/tools/oss-fuzz.sh
@@ -35,7 +35,7 @@ else
apt-get update
apt-get install -y gperf m4 gettext python3-pip \
libcap-dev libmount-dev libkmod-dev \
- pkg-config wget python3-jinja2
+ pkg-config wget python3-jinja2 zipmerge
# gnu-efi is installed here to enable -Dgnu-efi behind which fuzz-bcd
# is hidden. It isn't linked against efi. It doesn't
@@ -98,3 +98,15 @@ wget -O "$OUT/fuzz-json.dict" https://raw.githubusercontent.com/rc0r/afl-fuzz/ma
find "$build" -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} "$OUT" \;
find src -type f -name "fuzz-*.dict" -exec cp {} "$OUT" \;
cp src/fuzz/*.options "$OUT"
+
+if [[ "$MERGE_WITH_OSS_FUZZ_CORPORA" == "yes" ]]; then
+ for f in "$OUT/"fuzz-*; do
+ [[ -x "$f" ]] || continue
+ fuzzer=$(basename "$f")
+ t=$(mktemp)
+ if wget -O "$t" "https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_${fuzzer}/public.zip"; then
+ zipmerge "$OUT/${fuzzer}_seed_corpus.zip" "$t"
+ fi
+ rm -rf "$t"
+ done
+fi