u-root: esxi, ipxe & smbios fuzz (#9021)

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
This commit is contained in:
Fabian Wienand 2022-11-21 11:44:09 +01:00 committed by GitHub
parent 982660a57c
commit acc42bd102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 1 deletions

View File

@ -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
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