From patchwork Fri Aug 24 21:50:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 962117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xw2P6YKXz9ryt for ; Sat, 25 Aug 2018 07:50:53 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0677FD9F; Fri, 24 Aug 2018 21:50:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8E4FAD12 for ; Fri, 24 Aug 2018 21:50:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9A4EE7BF for ; Fri, 24 Aug 2018 21:50:21 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 404CC20002; Fri, 24 Aug 2018 21:50:17 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 14:50:11 -0700 Message-Id: <20180824215014.13635-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 1/4] tests: Add regression tests for all the bugs found by oss-fuzz so far. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This will make it harder for bugs found by oss-fuzz to reappear. Signed-off-by: Ben Pfaff Tested-by: Yifeng Sun Reviewed-by: Yifeng Sun --- tests/automake.mk | 33 +++++++++++++++++++++ tests/fuzz-regression-list.at | 23 ++++++++++++++ tests/fuzz-regression.at | 21 +++++++++++++ .../flow_extract_fuzzer-5112775280951296 | Bin 0 -> 54 bytes .../flow_extract_fuzzer-5457710546944000 | Bin 0 -> 227 bytes .../json_parser_fuzzer-4790908707930112 | Bin 0 -> 43 bytes .../ofp_print_fuzzer-4584019764183040 | Bin 0 -> 128 bytes .../ofp_print_fuzzer-4730143510626304 | Bin 0 -> 12 bytes .../ofp_print_fuzzer-4854119633256448 | Bin 0 -> 48 bytes .../ofp_print_fuzzer-5070973479944192 | Bin 0 -> 112 bytes .../ofp_print_fuzzer-5072291707748352 | Bin 0 -> 112 bytes .../ofp_print_fuzzer-5147430386401280 | Bin 0 -> 128 bytes .../ofp_print_fuzzer-5168455220199424 | Bin 0 -> 80 bytes .../ofp_print_fuzzer-5190507327127552 | Bin 0 -> 113 bytes .../ofp_print_fuzzer-5204186701496320 | Bin 0 -> 80 bytes .../ofp_print_fuzzer-5394482341085184 | Bin 0 -> 128 bytes .../ofp_print_fuzzer-5395207246839808 | Bin 0 -> 156 bytes .../ofp_print_fuzzer-5647458888581120 | Bin 0 -> 48 bytes .../ofp_print_fuzzer-5674119268925440 | Bin 0 -> 96 bytes .../ofp_print_fuzzer-5674419757252608 | Bin 0 -> 112 bytes .../ofp_print_fuzzer-5677588436484096 | Bin 0 -> 128 bytes .../ofp_print_fuzzer-5706562554298368 | Bin 0 -> 72 bytes .../ofp_print_fuzzer-5722747668791296 | Bin 0 -> 120 bytes .../ofp_print_fuzzer-6285128790704128 | Bin 0 -> 128 bytes .../ofp_print_fuzzer-6470117922701312 | Bin 0 -> 256 bytes .../ofp_print_fuzzer-6502620041576448 | Bin 0 -> 128 bytes tests/testsuite.at | 1 + 27 files changed, 78 insertions(+) create mode 100644 tests/fuzz-regression-list.at create mode 100644 tests/fuzz-regression.at create mode 100644 tests/fuzz-regression/flow_extract_fuzzer-5112775280951296 create mode 100644 tests/fuzz-regression/flow_extract_fuzzer-5457710546944000 create mode 100644 tests/fuzz-regression/json_parser_fuzzer-4790908707930112 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-4584019764183040 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-4730143510626304 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-4854119633256448 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5070973479944192 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5072291707748352 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5147430386401280 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5168455220199424 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5190507327127552 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5204186701496320 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5394482341085184 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5395207246839808 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5647458888581120 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5674119268925440 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5674419757252608 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5677588436484096 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5706562554298368 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-5722747668791296 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-6285128790704128 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-6470117922701312 create mode 100644 tests/fuzz-regression/ofp_print_fuzzer-6502620041576448 diff --git a/tests/automake.mk b/tests/automake.mk index b29a37ec840a..d5d53cdd18ae 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -37,6 +37,8 @@ TESTSUITE_AT = \ tests/ofp-util.at \ tests/ofp-errors.at \ tests/ovs-ofctl.at \ + tests/fuzz-regression.at \ + tests/fuzz-regression-list.at \ tests/odp.at \ tests/mpls-xlate.at \ tests/multipath.at \ @@ -108,6 +110,37 @@ TESTSUITE_AT = \ tests/packet-type-aware.at \ tests/nsh.at +EXTRA_DIST += $(FUZZ_REGRESSION_TESTS) +FUZZ_REGRESSION_TESTS = \ + tests/fuzz-regression/flow_extract_fuzzer-5112775280951296 \ + tests/fuzz-regression/flow_extract_fuzzer-5457710546944000 \ + tests/fuzz-regression/json_parser_fuzzer-4790908707930112 \ + tests/fuzz-regression/ofp_print_fuzzer-4584019764183040 \ + tests/fuzz-regression/ofp_print_fuzzer-4730143510626304 \ + tests/fuzz-regression/ofp_print_fuzzer-4854119633256448 \ + tests/fuzz-regression/ofp_print_fuzzer-5070973479944192 \ + tests/fuzz-regression/ofp_print_fuzzer-5072291707748352 \ + tests/fuzz-regression/ofp_print_fuzzer-5147430386401280 \ + tests/fuzz-regression/ofp_print_fuzzer-5168455220199424 \ + tests/fuzz-regression/ofp_print_fuzzer-5190507327127552 \ + tests/fuzz-regression/ofp_print_fuzzer-5204186701496320 \ + tests/fuzz-regression/ofp_print_fuzzer-5394482341085184 \ + tests/fuzz-regression/ofp_print_fuzzer-5395207246839808 \ + tests/fuzz-regression/ofp_print_fuzzer-5647458888581120 \ + tests/fuzz-regression/ofp_print_fuzzer-5674119268925440 \ + tests/fuzz-regression/ofp_print_fuzzer-5674419757252608 \ + tests/fuzz-regression/ofp_print_fuzzer-5677588436484096 \ + tests/fuzz-regression/ofp_print_fuzzer-5706562554298368 \ + tests/fuzz-regression/ofp_print_fuzzer-5722747668791296 \ + tests/fuzz-regression/ofp_print_fuzzer-6285128790704128 \ + tests/fuzz-regression/ofp_print_fuzzer-6470117922701312 \ + tests/fuzz-regression/ofp_print_fuzzer-6502620041576448 +$(srcdir)/tests/fuzz-regression-list.at: tests/automake.mk + for name in $(FUZZ_REGRESSION_TESTS); do \ + basename=`echo $$name | sed 's,^.*/,,'`; \ + echo "TEST_FUZZ_REGRESSION([$$basename])"; \ + done > $@.tmp && mv $@.tmp $@ + SYSTEM_KMOD_TESTSUITE_AT = \ tests/system-common-macros.at \ tests/system-kmod-testsuite.at \ diff --git a/tests/fuzz-regression-list.at b/tests/fuzz-regression-list.at new file mode 100644 index 000000000000..e3173fb88f01 --- /dev/null +++ b/tests/fuzz-regression-list.at @@ -0,0 +1,23 @@ +TEST_FUZZ_REGRESSION([flow_extract_fuzzer-5112775280951296]) +TEST_FUZZ_REGRESSION([flow_extract_fuzzer-5457710546944000]) +TEST_FUZZ_REGRESSION([json_parser_fuzzer-4790908707930112]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-4584019764183040]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-4730143510626304]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-4854119633256448]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5070973479944192]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5072291707748352]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5147430386401280]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5168455220199424]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5190507327127552]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5204186701496320]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5394482341085184]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5395207246839808]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5647458888581120]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5674119268925440]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5674419757252608]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5677588436484096]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5706562554298368]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-5722747668791296]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-6285128790704128]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-6470117922701312]) +TEST_FUZZ_REGRESSION([ofp_print_fuzzer-6502620041576448]) diff --git a/tests/fuzz-regression.at b/tests/fuzz-regression.at new file mode 100644 index 000000000000..9de460a5630b --- /dev/null +++ b/tests/fuzz-regression.at @@ -0,0 +1,21 @@ +AT_BANNER([fuzz regression]) + +OVS_START_SHELL_HELPERS +test_fuzz_regression() { + filename=$top_srcdir/tests/fuzz-regression/$1 + AS_CASE([$1], + [flow_extract_fuzzer*], [ovs-ofctl parse-packet < $filename], + [ofp_print_fuzzer*], [ovs-ofctl ofp-parse - < $filename], + [json_parser_fuzzer*], [ovstest test-json $filename], + [*], [AT_FAIL_IF([:])]) + status=$? + AT_CHECK([test $status = 0 || test $status = 1]) +} +OVS_END_SHELL_HELPERS + +m4_define([TEST_FUZZ_REGRESSION], + [AT_SETUP([fuzz regression - $1]) + test_fuzz_regression $1 + AT_CLEANUP]) + +m4_include([tests/fuzz-regression-list.at]) diff --git a/tests/fuzz-regression/flow_extract_fuzzer-5112775280951296 b/tests/fuzz-regression/flow_extract_fuzzer-5112775280951296 new file mode 100644 index 0000000000000000000000000000000000000000..610d259f9f44193a5f36cef1ea4923e57ad4876a GIT binary patch literal 54 TcmY#TK!CQpAT|R+04ECo7)Ky+3CDADZ=+m2ez=f7y<-) L^=ld0Ylj~XH*q5* literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-4730143510626304 b/tests/fuzz-regression/ofp_print_fuzzer-4730143510626304 new file mode 100644 index 0000000000000000000000000000000000000000..6001b7360bbbc8a46f68fee9f8d311ee3260a6c7 GIT binary patch literal 12 QcmZQ$WZ+Q%g8x7a00_qc^8f$< literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-4854119633256448 b/tests/fuzz-regression/ofp_print_fuzzer-4854119633256448 new file mode 100644 index 0000000000000000000000000000000000000000..b76d96317205b0c9fa3d1b7000f10ca4a562727c GIT binary patch literal 48 lcmZSQXE0Du_^$u~{}mV*fIKi@5Mp2ubzop%V1!D7DF8Wq3#R}8 literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5070973479944192 b/tests/fuzz-regression/ofp_print_fuzzer-5070973479944192 new file mode 100644 index 0000000000000000000000000000000000000000..3bc5c3c9663b66f82bc7f7958fcfc88563432ee7 GIT binary patch literal 112 zcmZPLPIqF2dQD;V_;at$iTqB1QG-QQ$sF9 literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5147430386401280 b/tests/fuzz-regression/ofp_print_fuzzer-5147430386401280 new file mode 100644 index 0000000000000000000000000000000000000000..020e06dc0f39c3364ca1e180e43ddf64a87d5aa1 GIT binary patch literal 128 zcmZSNV`xwSf&VZP!T^cDSzsv?;=cj|ObbN(|9=Jr1_osX23{0(P|km3 literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5190507327127552 b/tests/fuzz-regression/ofp_print_fuzzer-5190507327127552 new file mode 100644 index 0000000000000000000000000000000000000000..2e7669ce0a9162ac99eb687594b0de0b0fe4a689 GIT binary patch literal 113 zcmZPt<8 literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5394482341085184 b/tests/fuzz-regression/ofp_print_fuzzer-5394482341085184 new file mode 100644 index 0000000000000000000000000000000000000000..b42c9932509456ef40635f4f2fbc48ce4c4e8069 GIT binary patch literal 128 zcmYj{$qfJ?48zO1PqKoJORWa2mJs4AEFJ&00C4p{{LsNU|>*IU=TnRXJA%f0E^UtNQh2^ HRt5$DVtFH( literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5647458888581120 b/tests/fuzz-regression/ofp_print_fuzzer-5647458888581120 new file mode 100644 index 0000000000000000000000000000000000000000..2a803ce5b93b850f7977323daba3356d5e231234 GIT binary patch literal 48 xcmZSOWiU_x19lb$1|BvB2}TE71_p!w{~0707?c$l^kPLBK!Amjfr)`Z0RV$D1qJ{B literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5674119268925440 b/tests/fuzz-regression/ofp_print_fuzzer-5674119268925440 new file mode 100644 index 0000000000000000000000000000000000000000..6d0704c31c9de3a84ab059ad86cf3abce816b60f GIT binary patch literal 96 zcmZSQXGl;00tN;~5Cxf696$B6u$rf literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5674419757252608 b/tests/fuzz-regression/ofp_print_fuzzer-5674419757252608 new file mode 100644 index 0000000000000000000000000000000000000000..7c3be52fe36d910da0eaddcf11420023a94fe735 GIT binary patch literal 112 zcmZPb777(^Wy7=RN0|0`r97H2U02P;7#7#Jr2btotR E0FjIk?*IS* literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5722747668791296 b/tests/fuzz-regression/ofp_print_fuzzer-5722747668791296 new file mode 100644 index 0000000000000000000000000000000000000000..aa18ede78895fc94ef0a6ee4805b2577f024047f GIT binary patch literal 120 zcmZSNW2jId0RAf|01*uQhp-u7d@{nb)u`yKx E00{IZ*Z=?k literal 0 HcmV?d00001 diff --git a/tests/fuzz-regression/ofp_print_fuzzer-6502620041576448 b/tests/fuzz-regression/ofp_print_fuzzer-6502620041576448 new file mode 100644 index 0000000000000000000000000000000000000000..82534e60c6fc25c4565bd9b61139224140c0978d GIT binary patch literal 128 zcmZSNV`yMtI-su3^qv6-IJg@AGYBxSGB7az|NozXnc*J;17icjM5EI&(82)M1jG90jSu5fk9b;K|oo-<30le6N3WKU