From acc42bd102cd88a0790140f0dc94ea4266f2990e Mon Sep 17 00:00:00 2001 From: Fabian Wienand Date: Mon, 21 Nov 2022 11:44:09 +0100 Subject: [PATCH] u-root: esxi, ipxe & smbios fuzz (#9021) Signed-off-by: Fabian Wienand Signed-off-by: Fabian Wienand --- projects/u-root/build.sh | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/projects/u-root/build.sh b/projects/u-root/build.sh index 843841e3a..66896141a 100755 --- a/projects/u-root/build.sh +++ b/projects/u-root/build.sh @@ -90,4 +90,46 @@ cp $SRC/u-root/cmds/exp/gosh/testdata/fuzz/*.dict $SRC/u-root/cmds/exp/gosh/test ## FuzzRun find $SRC/u-root/cmds/exp/gosh/testdata/fuzz/corpora -name "*.seed" -exec zip $OUT/fuzz_gosh_run_seed_corpus.zip {} + -compile_native_go_fuzzer $SRC/u-root/cmds/exp/gosh FuzzRun fuzz_gosh_run \ No newline at end of file +compile_native_go_fuzzer $SRC/u-root/cmds/exp/gosh FuzzRun fuzz_gosh_run + +# esxi pkg +cd $SRC/u-root/pkg/boot/esxi +go mod init esxi +go mod tidy +go install github.com/AdamKorcz/go-118-fuzz-build@latest +go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes +go get github.com/AdamKorcz/go-118-fuzz-build/utils + +cp $SRC/u-root/pkg/boot/esxi/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/esxi/testdata/fuzz/*.options $OUT + +## FuzzParse +find $SRC/u-root/pkg/boot/esxi/testdata -name "*.cfg" -exec zip $OUT/fuzz_esxi_parse_seed_corpus.zip {} + +compile_native_go_fuzzer $SRC/u-root/pkg/boot/esxi FuzzParse fuzz_esxi_parse + +# ipxe pkg +cd $SRC/u-root/pkg/boot/netboot/ipxe +go mod init ipxe +go mod tidy +go install github.com/AdamKorcz/go-118-fuzz-build@latest +go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes +go get github.com/AdamKorcz/go-118-fuzz-build/utils + +cp $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/*.options $OUT + +## FuzzParseIpxeConfig +find $SRC/u-root/pkg/boot/netboot/ipxe/testdata/fuzz/corpora -name "*.seed" -exec zip $OUT/fuzz_ipxe_parse_config_seed_corpus.zip {} + +compile_native_go_fuzzer $SRC/u-root/pkg/boot/netboot/ipxe FuzzParseIpxeConfig fuzz_ipxe_parse_config + +# smbios pkg +cd $SRC/u-root/pkg/smbios +go mod init smbios +go mod tidy +go install github.com/AdamKorcz/go-118-fuzz-build@latest +go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes +go get github.com/AdamKorcz/go-118-fuzz-build/utils + +cp $SRC/u-root/pkg/smbios/testdata/fuzz/*.dict $SRC/u-root/pkg/smbios/testdata/fuzz/*.options $OUT + +## FuzzParseInfo +find $SRC/u-root/pkg/smbios/testdata -name "*.bin" -exec zip $OUT/fuzz_smbios_parse_info_seed_corpus.zip {} + +compile_native_go_fuzzer $SRC/u-root/pkg/smbios FuzzParseInfo fuzz_smbios_parse_info \ No newline at end of file