[ovs-dev] [PATCH] ossfuzz: Add new target for ODP parsing

bshastry at sect.tu-berlin.de bshastry at sect.tu-berlin.de
Tue Oct 2 23:09:41 UTC 2018


From: Bhargava Shastry <bshastry at sect.tu-berlin.de>

This patch adds a new oss-fuzz target for the ODP parser. The
 target harness has been adapted from test-odp.c. Prominently, it leaves out
 "parse_filter" due to an  unresolvable bug in that code at the time of
 writing.

It also includes the following:
  - a fuzzing dictionary
  - fuzzing config
  - some automake additions for the new target

Signed-off-by: Bhargava Shastry <bshastry at sect.tu-berlin.de>
---
 tests/oss-fuzz/automake.mk | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/oss-fuzz/automake.mk b/tests/oss-fuzz/automake.mk
index 3e3ac2f9c..4fbdb4c2b 100644
--- a/tests/oss-fuzz/automake.mk
+++ b/tests/oss-fuzz/automake.mk
@@ -2,7 +2,8 @@ OSS_FUZZ_TARGETS = \
 	tests/oss-fuzz/flow_extract_target \
 	tests/oss-fuzz/json_parser_target \
 	tests/oss-fuzz/ofp_print_target \
-	tests/oss-fuzz/expr_parse_target
+	tests/oss-fuzz/expr_parse_target \
+	tests/oss-fuzz/odp_target
 EXTRA_PROGRAMS += $(OSS_FUZZ_TARGETS)
 oss-fuzz-targets: $(OSS_FUZZ_TARGETS)
 
@@ -31,10 +32,18 @@ tests_oss_fuzz_expr_parse_target_LDADD = lib/libopenvswitch.la \
                                          ovn/lib/libovn.la
 tests_oss_fuzz_expr_parse_target_LDFLAGS = $(LIB_FUZZING_ENGINE) -lc++
 
+tests_oss_fuzz_odp_target_SOURCES = \
+        tests/oss-fuzz/odp_target.c \
+        tests/oss-fuzz/fuzzer.h
+tests_oss_fuzz_odp_target_LDADD = lib/libopenvswitch.la
+tests_oss_fuzz_odp_target_LDFLAGS = $(LIB_FUZZING_ENGINE) -lc++
+
 EXTRA_DIST += \
 	tests/oss-fuzz/config/flow_extract_target.options \
 	tests/oss-fuzz/config/json_parser_target.options \
 	tests/oss-fuzz/config/ofp_print_target.options \
 	tests/oss-fuzz/config/expr_parse_target.options \
+	tests/oss-fuzz/config/odp_target.options \
 	tests/oss-fuzz/config/ovs.dict \
-	tests/oss-fuzz/config/expr.dict
+	tests/oss-fuzz/config/expr.dict \
+	tests/oss-fuzz/config/odp.dict
-- 
2.17.1



More information about the dev mailing list