summaryrefslogtreecommitdiffstats
path: root/test/fuzz-regressions
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-19 07:54:30 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-27 09:03:46 +0100
commitb68dfb9e83dc2d12cf9d8ae5ef3ddaca537a8519 (patch)
tree85cb8927ca64fa6f09b87cf22e294a9fd9218111 /test/fuzz-regressions
parentfuzz: add a note on reporting security bugs to HACKING (diff)
downloadsystemd-b68dfb9e83dc2d12cf9d8ae5ef3ddaca537a8519.tar.xz
systemd-b68dfb9e83dc2d12cf9d8ae5ef3ddaca537a8519.zip
Hook up oss-fuzz test cases as tests
This is a bit painful because a separate build of systemd is necessary. The tests are guarded by tests!=false and slow-tests==true. Running them is not slow, but compilation certainly is. If this proves unwieldy, we can add a separate option controlling those builds later. The build for each sanitizer has its own directory, and we build all fuzzer tests there, and then pull them out one-by-one by linking into the target position as necessary. It would be nicer to just build the desired fuzzer, but we need to build the whole nested build as one unit. [I also tried making systemd and nested meson subproject. This would work nicely, but meson does not allow that because the nested target names are the same as the outer project names. If that is ever fixed, that would be the way to go.] v2: - make sure things still work if memory sanitizer is not available v3: - switch to syntax which works with meson 0.42.1 found in Ubuntu
Diffstat (limited to 'test/fuzz-regressions')
-rw-r--r--test/fuzz-regressions/meson.build30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/fuzz-regressions/meson.build b/test/fuzz-regressions/meson.build
new file mode 100644
index 0000000000..de69c941ea
--- /dev/null
+++ b/test/fuzz-regressions/meson.build
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# Copyright 2018 Zbigniew Jędrzejewski-Szmek
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+sanitize_address = custom_target(
+ 'sanitize-address-fuzzers',
+ output : 'sanitize-address-fuzzers',
+ command : [meson_build_sh,
+ meson.source_root(),
+ '@OUTPUT@',
+ 'fuzzers',
+ '-Db_lundef=false -Db_sanitize=address'])
+
+fuzz_regression_tests = '''
+ address/fuzz-dns-packet/oss-fuzz-5465
+ address/fuzz-dns-packet/issue-7888
+'''.split()