[ovs-dev] [PATCH v2 2/2] tests: Add regression tests for all the bugs found by oss-fuzz so far.

Ben Pfaff blp at ovn.org
Thu Aug 30 20:58:50 UTC 2018


This will make it harder for bugs found by oss-fuzz to reappear.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Tested-by: Yifeng Sun <pkusunyifeng at gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
---
 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+04ECo<W~p8

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/flow_extract_fuzzer-5457710546944000 b/tests/fuzz-regression/flow_extract_fuzzer-5457710546944000
new file mode 100644
index 0000000000000000000000000000000000000000..2d65673e736d9cee7cea231ed627e9ed9b7f9a17
GIT binary patch
literal 227
ocmY#TK!CQpAU4AlD})dZRyzX at 2}Y<miS&P%dL}e;Vd9j~009jhD*ylh

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/json_parser_fuzzer-4790908707930112 b/tests/fuzz-regression/json_parser_fuzzer-4790908707930112
new file mode 100644
index 0000000000000000000000000000000000000000..87d5f34dc6e4e59ffd679fadd9eea4d3eb8d0ea2
GIT binary patch
literal 43
tcmWN<0TBQo3<5x-7{LL at Mj-oF(7&e+2DF0{j!e1wFDtnywT5Qz^#H@$2)+OS

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-4584019764183040 b/tests/fuzz-regression/ofp_print_fuzzer-4584019764183040
new file mode 100644
index 0000000000000000000000000000000000000000..c0b9ae23c217d2eb3da03fef89cb75579f22da34
GIT binary patch
literal 128
zcmX|(*$n_72t%I>7)Ky+3CDAD<dS|gr3Yhj#i7NT!i-jtG*yln>Z=+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 at 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
zcmZP<W++eq0tOZk38WK%m;uC6Q1}m_AdLSC{~-X#MV3HtKsrD&2oWIf|9=Jn28LCP
K3=9lRAV~nt-XS#r

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5072291707748352 b/tests/fuzz-regression/ofp_print_fuzzer-5072291707748352
new file mode 100644
index 0000000000000000000000000000000000000000..633cc1ef3bb8dccfcaeceac9a70b76e6de94328c
GIT binary patch
literal 112
zcmZP<W++eq0tOZk38WK%m;uDX0scb)P#VU>LPIqF2dQD;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<AKJ4O$HMH
D|63hU

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5168455220199424 b/tests/fuzz-regression/ofp_print_fuzzer-5168455220199424
new file mode 100644
index 0000000000000000000000000000000000000000..523b3766ed6ab820d1473ece783ad5469e23f2f1
GIT binary patch
literal 80
xcmZSQX9!RL0tN;~5Cx<a6#jz&gE<3(r~?C3A|tUlgW*3|2 at 1i$z`=wp0069x4?F+>

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
zcmZP<W++eq0tOZk38WK%m;uDX2mZqVLJ?2|i34E*MgIS1;A3D|#mK<GzyuZq09&^k
AIsgCw

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5204186701496320 b/tests/fuzz-regression/ofp_print_fuzzer-5204186701496320
new file mode 100644
index 0000000000000000000000000000000000000000..045d93662aa9d2fdfde556f667702ae119365488
GIT binary patch
literal 80
YcmZSNV+c?n2QWZ2{Rh+kA(Vmw0He_iT>t<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?48zO<h!HBW023lM4_8IW%TAIq!y+=tO^;&U<U0qKT$gB2jj}%xFpl-;
Fewt&48RY-~

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5395207246839808 b/tests/fuzz-regression/ofp_print_fuzzer-5395207246839808
new file mode 100644
index 0000000000000000000000000000000000000000..6b566688f3be4a20dbce4d1aa654c9a39f9d5424
GIT binary patch
literal 156
zcmZP+WSFA>1PqKoJORWa2mJs4AEFJ&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;~5Cx<a6#jz&g98JDC=fG%B{C9=GZ_AZl|YF9KxH8HjFW&W769=y
J9wb>f696$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
zcmZP<W++eq0tOZk38WMLD=;u9{09RF1(Eo#0OUcK2oj<UNiA3vkdLH?L4bi_6(a)!
I0~1IP04O0a1ONa4

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5677588436484096 b/tests/fuzz-regression/ofp_print_fuzzer-5677588436484096
new file mode 100644
index 0000000000000000000000000000000000000000..85665f521bbd6a58ac94af80824e5c32afa81df2
GIT binary patch
literal 128
zcmZSQXJ}9W0tN;~5Cx<a6#jz&Lofq_r~?C3A|tUlgW*3=4y+1DKp6~-^Wbcl6agAy
HJXAjbT{a%`

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-5706562554298368 b/tests/fuzz-regression/ofp_print_fuzzer-5706562554298368
new file mode 100644
index 0000000000000000000000000000000000000000..d2dd2befec21dc95ec003a653beceff875a4d761
GIT binary patch
literal 72
zcmZSQXYfz}f(8ag5T(GtprG&{3>b777(^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<gyjKZ67VgR%mHih=?Ig92O at F0KVp$H2hA0Wtsp
D-(nQ&

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-6285128790704128 b/tests/fuzz-regression/ofp_print_fuzzer-6285128790704128
new file mode 100644
index 0000000000000000000000000000000000000000..ab820aaddcea328b1beda5e3d7e2a7791c5780cc
GIT binary patch
literal 128
zcmZSNV`xwSgZ~f;NCH_14qOx at fh5cT;lM=x|7WmZU{F?I(1M5n`3hjZ at _!)Bz<^;Q
INEr|V06V-LY5)KL

literal 0
HcmV?d00001

diff --git a/tests/fuzz-regression/ofp_print_fuzzer-6470117922701312 b/tests/fuzz-regression/ofp_print_fuzzer-6470117922701312
new file mode 100644
index 0000000000000000000000000000000000000000..c5b9c189f6a8d852ced7bde198297c56bb0d6f61
GIT binary patch
literal 256
zcmZSNVq{Q20{{QRI3QNrT at a7qHUmr$C(Qs=LN3iFfYWHW1juRsfe;y>@{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 at AGYBxSGB7az|NozXnc*J;17icjM<zZ74mJUX9e=;u
z{0GXp0TnPXu>5EI&(82)M1jG90jSu5fk9b;K|oo-<30le6N3WKU<A<US-_wr4Kf%6
JeuLOx002u%82tbM

literal 0
HcmV?d00001

diff --git a/tests/testsuite.at b/tests/testsuite.at
index 690904e30881..b840dbfa7048 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -37,6 +37,7 @@ m4_include([tests/ofp-print.at])
 m4_include([tests/ofp-util.at])
 m4_include([tests/ofp-errors.at])
 m4_include([tests/ovs-ofctl.at])
+m4_include([tests/fuzz-regression.at])
 m4_include([tests/odp.at])
 m4_include([tests/mpls-xlate.at])
 m4_include([tests/multipath.at])
-- 
2.16.1



More information about the dev mailing list