From 647c21f1cb4965145fa298bd093ce9a2d955d04f Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Sat, 15 Jul 2023 16:00:21 +0200 Subject: [PATCH] fuzz: institute sane limits for arbitrary-based fuzzers Closes #1043 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61570 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62436 --- fuzz/ast-fuzzers.options | 2 ++ fuzz/oss-fuzz-build.sh | 5 ++++- ...e-minimized-ast_fuzz_match-5990349284442112 | Bin 0 -> 169710 bytes ...e-minimized-ast_fuzz_match-6114393576046592 | Bin 0 -> 51466 bytes ...mized-ast_fuzz_match_bytes-4820641084473344 | Bin 0 -> 47681 bytes 5 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 fuzz/ast-fuzzers.options create mode 100644 fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-5990349284442112 create mode 100644 fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-6114393576046592 create mode 100644 fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match_bytes-4820641084473344 diff --git a/fuzz/ast-fuzzers.options b/fuzz/ast-fuzzers.options new file mode 100644 index 000000000..678d526b1 --- /dev/null +++ b/fuzz/ast-fuzzers.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 65536 diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh index f96474739..81f619dcb 100755 --- a/fuzz/oss-fuzz-build.sh +++ b/fuzz/oss-fuzz-build.sh @@ -14,5 +14,8 @@ targets=( ast_fuzz_match_bytes ) for target in "${targets[@]}"; do - cp fuzz/target/x86_64-unknown-linux-gnu/release/$target $OUT/ + cp "fuzz/target/x86_64-unknown-linux-gnu/release/${target}" "${OUT}/" + if [[ "$target" == ast_* ]]; then + cp fuzz/ast-fuzzers.options "${OUT}/${target}.options" + fi done diff --git a/fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-5990349284442112 b/fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-5990349284442112 new file mode 100644 index 0000000000000000000000000000000000000000..8de974975d4227f6da75038a92caa08dc6feac23 GIT binary patch literal 169710 zcmeI5F^=Rm7KRJh#20YS8C(koK0yPUj2C+e!*FE4FyO?Q53n875h|J!IGAH7oowR? zeE_4EeAFZPC_VK^WYx~Pzk(sY$C5bG&yT-IRdxCF_U-fE-abA)o*v))=ed48{^Q^A zzsE~@{e3Q1i*Vd({Z{3;2IE=xpX!r;va6?ho%grb9?zwIo$BOPv7AY0+`ocp{jJpt z(_J?k)Sa}9m-a#*s9=|i+w$H%sQz^gLmAKI?l1ZG-*3PE`R%v=(mkF(emp%sKm2sc zuXi6FPt{eFaJ83I&2XV*&&8#KUlvCN1HXtM_+2im<4Sq4<4S9tGP(`!r`G0_xSyp5 z{Nk_~@)BVk?6eyEz;6g_%SOPjo`YJn}wDekxA=wOW~sy648xSz!k{0_plJPiDB zzcjd(Y}}y+{J;gCF=ECv5Xb@MG?m2G=Gg zw|W!&zz_VI(Z$juArZDLJ(&At7$jin(YVF&RP@v}hEswc_#G!~^GNVx?w1DFCMLIf z^A+Q_kW{n?wW&MSw$oZAKYOrH@_2;^?A(R5n!B;Zkjdb2-kKx95BE!hs{!LaDfodO z_%&mV2Z0HRu)XFeXq00UJekZSJLU;Z7u+Y6lhsL{Q!@86UCJ-6jYAXsRxD+QXIL;7 zS?nl&(a*6pt;XIgH{dtS->|n8dsEsb4QvU1;McE!Fcq4yY}MIRCnW~Ie(~oPL{z=Y zIwd#Xf?kZk5B&NS5T-&imaRIQ>ZHWr*DwCuf{5z4o>t?21-%%7ANchvAWVg3EL(Lp z)k%rLuV4JR1rb$k&M9%ff?kZk5B&NS5T-&imaRIQ>ZHWr*DwCuf{5z4o>t?21-%%7 zANchvAWVg3EL(Lp)k%rLuV4JR1rb$k&M9%ff?kZk5B&NS5T-&imaRIQ>ZHWr*DwCu zf{5z4o>t?21-%%7ANchvAWVg3EL(Lp)k%rLuV4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R;j6ZXU^AP^bg+Fs? z&7vchQKs`-r)1ijy-0#pTi0Ezt!u4Q#*X8+UL5SS8vHCh;Md`I_D~U4Ide+z`)lH- z)5<_Zb%BXN8}J+Ej3TUqomPV%_zeTjHUxh4BEe$DuM%2TZjgZ=_@zO21Grvp z68yjq{F-sXC)5dvu;s}ZOOFhL1gv};w>X}Pp1Q6P960r1W+~RmDdg>a(DPP9#v;2eX{{n8r{}2EG literal 0 HcmV?d00001 diff --git a/fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-6114393576046592 b/fuzz/regressions/clusterfuzz-testcase-minimized-ast_fuzz_match-6114393576046592 new file mode 100644 index 0000000000000000000000000000000000000000..a34eeaf2c0d2ba02b5f35ae85b06cfec4f1089b0 GIT binary patch literal 51466 zcmeIzv2Gi60LSrbDi(x?A|#eFAdnbH!Eqc1q*^DsWbKp=nM~z~LNJv8DH0M=pCE5w z1`ln=NGv=;o}v;9D?Gt*=S#x*n{Px!1ysuKKREt+ei}o6-qvq3B&eq}PMt{5i zdv#vdZZsF#FBawEhs9!k-WQAan-})?o5$|?>ftwEKc0N|=<{w|{`4m&Cr3v|H|u^} zpI?rT$Fur;G<#9KRkznZKD^V&H0QVWOXsnus`7qyx2h&`ewxqA?+@qm`3KJ?v)Oq3 z$LSmE&w2OD$?Q@0O0NEVttjqn4n|v_)^91_C~g(&r>FTAH*OVgo`0*`opZN-TXXjH zw69(9aX1_nwbsGG!A5_p*PN9%{`K-;`Qn9#d;j39{q1`$d$7t2SzmAC^6~7CKpQXpGqAjEH@CFYV^`X{{0DuRSM;M0 zg9H$pK{6GzAOXZ?kW2+FNC2@JBvU~P5*Y* zW{^w;El2>d86;Cd3lczV2FX;=f&>toK{6GzAOXZ?kW2+FNC2@JBvU~P5*Y*W{^w;El2>d86;Cd3lczV2FX;=f&>toK{6GzAOXZ? zkW2+FNC2@JBvU~P5*Y*W{^w;El2>d86;Cd z3lczV2FX;=f&>toK{6GzAOXZ?kW2+FNC2@JBvU~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