From 697d0d2835c9c47eb5a84fcb0b587a7ee7ebe7a6 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 12 Aug 2020 21:21:42 +0200 Subject: [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 --- projects/bind9/Dockerfile | 34 ++++++++++++++++++++++++++++++++++ projects/bind9/build.sh | 39 +++++++++++++++++++++++++++++++++++++++ projects/bind9/project.yaml | 11 +++++++++++ 3 files changed, 84 insertions(+) create mode 100644 projects/bind9/Dockerfile create mode 100644 projects/bind9/build.sh create mode 100644 projects/bind9/project.yaml 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 -- cgit v1.2.3