include $(top_srcdir)/Makefile.top
-SUBDIRS = . libltdl lib doc bin
+SUBDIRS = . libltdl lib doc bin fuzz
BUILT_SOURCES = bind.keys.h
CLEANFILES = bind.keys.h
AC_MSG_RESULT([using AFL])
AC_DEFINE([ENABLE_AFL], [1],
[Define to enable American Fuzzy Lop test harness])
- CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
- LIBS="$LIBS -lpthread"],
+ STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
+ FUZZ_LOG_COMPILER="afl.sh"],
[libfuzzer],[
AC_MSG_RESULT([using libFuzzer])
- CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer,address,undefined"
- LDFLAGS="$LDFLAGS -fsanitize=fuzzer,address,undefined"],
+ STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer-no-link,address,undefined"
+ LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
+ FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
+ FUZZ_LOG_COMPILER="libfuzzer.sh"],
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
+AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
+AC_SUBST([FUZZ_LOG_COMPILER])
+AC_SUBST([FUZZ_LDFLAGS])
AS_IF([test "$enable_fuzzing" = "afl"],
[AC_MSG_CHECKING("for AFL enabled compiler")
AC_CONFIG_FILES([bin/tests/system/stop.sh],
[chmod +x bin/tests/system/stop.sh])
+# Fuzz Tests
+
+AC_CONFIG_FILES([fuzz/Makefile])
+
# Misc
AC_CONFIG_FILES([util/check-make-install])
--- /dev/null
+include $(top_srcdir)/Makefile.top
+
+AM_CPPFLAGS += \
+ $(LIBISC_CFLAGS) \
+ $(LIBDNS_CFLAGS) \
+ -DFUZZDIR=\"$(abs_srcdir)\"
+
+AM_LDFLAGS = \
+ $(FUZZ_LDFLAGS)
+
+LDADD = \
+ libfuzzmain.la \
+ $(LIBISC_LIBS) \
+ $(LIBDNS_LIBS)
+
+check_LTLIBRARIES = libfuzzmain.la
+libfuzzmain_la_SOURCES = \
+ main.c
+
+check_PROGRAMS = \
+ dns_name_fromtext_target \
+ dns_rdata_fromwire_text \
+ isc_lex_getmastertoken \
+ isc_lex_gettoken
+
+EXTRA_DIST = \
+ dns_name_fromtext_target.in \
+ dns_rdata_fromwire_text.in \
+ isc_lex_getmastertoken.in \
+ isc_lex_gettoken.in
+
+TESTS = $(check_PROGRAMS)
+
+if HAVE_FUZZ_LOG_COMPILER
+LOG_COMPILER = $(srcdir)/$(FUZZ_LOG_COMPILER)
+AM_LOG_FLAGS = $(srcdir)
+endif HAVE_FUZZ_LOG_COMPILER
+
+unit-local: check
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+echo "The AFL log compiler is not implemented yet."
+
+exit 1
--- /dev/null
+#!/bin/sh -ex
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+exec "${2}" "${1}/$(basename "${2}").in" -max_total_time=5 -print_pcs=1 -print_final_stats=1 -print_corpus_stats=1 -print_coverage=1
./docutil/patch-db2latex-duplicate-template-bug X 2007,2018,2019,2020
./docutil/patch-db2latex-nested-param-bug X 2007,2018,2019,2020
./docutil/patch-db2latex-xsltproc-title-bug X 2007,2018,2019,2020
+./fuzz/afl.sh SH 2020
./fuzz/dns_name_fromtext_target.c C 2018,2019,2020
./fuzz/dns_rdata_fromwire_text.c C 2019,2020
./fuzz/fuzz.h C 2018,2019,2020
+./fuzz/libfuzzer.sh SH 2020
./fuzz/main.c C 2018,2019,2020
./lib/bind9/api X 2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
./lib/bind9/check.c C 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020