aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ondřej Surý <ondrej@sury.org>2020-08-12 21:21:42 +0200
committerGravatar GitHub <noreply@github.com>2020-08-12 12:21:42 -0700
commit697d0d2835c9c47eb5a84fcb0b587a7ee7ebe7a6 (patch)
tree9bc77edcdca1b24fd4f46686c6aebc96b4e93669
parent8712207990d3f7301d9f64019cc0c64a4f403b5a (diff)
[bind9] Add bind9 as new proposed oss-fuzz target (#4304)
* Add bind9 as new proposed oss-fuzz target * Add basic Dockerfile and build.sh * Change the auto_cc addresses to @isc.org * fix the copyright * fix the copyright Co-authored-by: Max Moroz <mmoroz@chromium.org>
-rw-r--r--projects/bind9/Dockerfile34
-rw-r--r--projects/bind9/build.sh39
-rw-r--r--projects/bind9/project.yaml11
3 files changed, 84 insertions, 0 deletions
diff --git a/projects/bind9/Dockerfile b/projects/bind9/Dockerfile
new file mode 100644
index 00000000..a62fb410
--- /dev/null
+++ b/projects/bind9/Dockerfile
@@ -0,0 +1,34 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+FROM gcr.io/oss-fuzz-base/base-builder
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get -y update && apt-get -y dist-upgrade
+RUN apt-get -y install \
+ autoconf \
+ automake \
+ autotools-dev \
+ bison \
+ build-essential \
+ libtool \
+ libtool-bin \
+ libssl-dev \
+ libuv1-dev \
+ pkg-config \
+ zip
+RUN git clone --depth 1 --branch ondrej/oss-fuzz https://gitlab.isc.org/isc-projects/bind9.git
+WORKDIR bind9
+COPY build.sh $SRC/
diff --git a/projects/bind9/build.sh b/projects/bind9/build.sh
new file mode 100644
index 00000000..d9ad8d55
--- /dev/null
+++ b/projects/bind9/build.sh
@@ -0,0 +1,39 @@
+#!/bin/sh -eu
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# build the project
+autoreconf -fi
+./configure --disable-shared --enable-static --enable-developer --without-cmocka --without-zlib --disable-linux-caps --prefix="$WORK"
+make -j"$(nproc)" all
+
+LIBISC_CFLAGS="-Ilib/isc/unix/include -Ilib/isc/pthreads/include -Ilib/isc/include"
+LIBDNS_CFLAGS="-Ilib/dns/include"
+LIBISC_LIBS="libltdl/.libs/libltdlc.a lib/isc/.libs/libisc.a -Wl,-Bstatic -lcrypto -luv -Wl,-Bdynamic"
+LIBDNS_LIBS="lib/dns/.libs/libdns.a -Wl,-Bstatic -lcrypto -Wl,-Bdynamic"
+
+for fuzzer in fuzz/*.c; do
+ output=$(basename "${fuzzer%.c}")
+ [ "$output" = "main" ] && continue
+ (cd fuzz && make "${output}.o")
+ ${CXX} ${CXXFLAGS} \
+ -o "${OUT}/${output}_fuzzer" \
+ "fuzz/${output}.o" \
+ -include config.h \
+ $LIBISC_CFLAGS $LIBDNS_CFLAGS \
+ $LIBDNS_LIBS $LIBISC_LIBS $LIB_FUZZING_ENGINE
+ zip -j "${OUT}/${output}_seed_corpus.zip" "fuzz/${output}.in/"*
+done
diff --git a/projects/bind9/project.yaml b/projects/bind9/project.yaml
new file mode 100644
index 00000000..2a908c20
--- /dev/null
+++ b/projects/bind9/project.yaml
@@ -0,0 +1,11 @@
+homepage: "https://gitlab.isc.org/isc-projects/bind9"
+language: c
+primary_contact: "security-officer@isc.org"
+auto_ccs:
+ - "ondrej@sury.org"
+ - "michal@isc.org"
+sanitizers:
+ - address
+ - memory:
+ experimental: True
+ - undefined