Skip to content

Commit 69aa498

Browse files
committed
ci: merge seed corpora with public OSS-Fuzz corpora on CFLite
to let it cover as much code as possible. It should help to catch most regressions in a few minutes.
1 parent e46c743 commit 69aa498

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.clusterfuzzlite/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM gcr.io/oss-fuzz-base/base-builder@sha256:14b332de0e18683f37386eaedbf735bc6e8d81f9c0e1138d620f2178e20cd30a
2+
ENV MERGE_WITH_OSS_FUZZ_CORPORA=yes
23
COPY . $SRC/systemd
34
WORKDIR $SRC/systemd
45
COPY tools/oss-fuzz.sh $SRC/build.sh

tools/oss-fuzz.sh

+13-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ else
3535
apt-get update
3636
apt-get install -y gperf m4 gettext python3-pip \
3737
libcap-dev libmount-dev libkmod-dev \
38-
pkg-config wget python3-jinja2
38+
pkg-config wget python3-jinja2 zipmerge
3939

4040
# gnu-efi is installed here to enable -Dgnu-efi behind which fuzz-bcd
4141
# 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
9898
find "$build" -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} "$OUT" \;
9999
find src -type f -name "fuzz-*.dict" -exec cp {} "$OUT" \;
100100
cp src/fuzz/*.options "$OUT"
101+
102+
if [[ "$MERGE_WITH_OSS_FUZZ_CORPORA" == "yes" ]]; then
103+
for f in "$OUT/"fuzz-*; do
104+
[[ -x "$f" ]] || continue
105+
fuzzer=$(basename "$f")
106+
t=$(mktemp)
107+
if wget -O "$t" "https://storage.googleapis.com/systemd-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/systemd_${fuzzer}/public.zip"; then
108+
zipmerge "$OUT/${fuzzer}_seed_corpus.zip" "$t"
109+
fi
110+
rm -rf "$t"
111+
done
112+
fi

0 commit comments

Comments
 (0)