golang: build upstream fuzzers (#8245)

Signed-off-by: AdamKorcz <adam@adalogics.com>

Signed-off-by: AdamKorcz <adam@adalogics.com>
This commit is contained in:
AdamKorcz 2022-08-13 19:20:20 +01:00 committed by GitHub
parent 54996950a0
commit 91e148cbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 45 additions and 2 deletions

View File

@ -47,16 +47,32 @@ compile_go_fuzzer $FUZZ_ROOT/xml Fuzz xml_fuzzer
compile_go_fuzzer $FUZZ_ROOT/zip Fuzz zip_fuzzer
compile_go_fuzzer $FUZZ_ROOT/zlib Fuzz zlib_fuzzer
cd $SRC/go/src/archive/tar
go mod init tarPackage
go mod tidy
find . -name "*_test.go" ! -name 'fuzz_test.go' -type f -exec rm -f {} +
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_native_go_fuzzer tarPackage FuzzReader fuzz_std_lib_tar_reader
cd $SRC && git clone https://github.com/AdamKorcz/instrumentation
cd instrumentation
go run main.go $SRC/go/src/archive/tar
cd $SRC/go/src/archive/tar
cp $SRC/fuzz_tar_reader.go ./
go mod init tarPackage
rm ./*_test.go
compile_go_fuzzer tarPackage FuzzTarReader fuzz_tar_reader
mv $SRC/fuzz_tar_reader.options $OUT/
cd $SRC/go/src/archive/zip
go mod init zipPackage
go mod tidy
find . -name "*_test.go" ! -name 'fuzz_test.go' -type f -exec rm -f {} +
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_native_go_fuzzer zipPackage FuzzReader fuzz_std_lib_zip_reader
cd $SRC/go/src/internal/saferio
go mod init saferioPackage
@ -72,4 +88,31 @@ rm ./*_test.go
compile_go_fuzzer elfPackage FuzzElfOpen fuzz_elf_open
zip $OUT/fuzz_elf_open_seed_corpus.zip ./testdata/*
mv $SRC/fuzz_tar_reader.options $OUT/
cd $SRC/go/src/image/png
go mod init pngPackage
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_native_go_fuzzer pngPackage FuzzDecode fuzz_png_decode
zip $OUT/fuzz_png_decode_seed_corpus.zip ./testdata/*.png
cd $SRC/go/src/image/gif
go mod init gifPackage
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_native_go_fuzzer gifPackage FuzzDecode fuzz_gif_decode
zip $OUT/fuzz_gif_decode_seed_corpus.zip $SRC/go/src/image/testdata/*.gif
cd $SRC/go/src/compress/gzip
go mod init gzipPackage
go mod tidy
find . -name "*_test.go" ! -name 'fuzz_test.go' -type f -exec rm -f {} +
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_native_go_fuzzer gzipPackage FuzzReader fuzz_std_lib_gzip_reader
cd $SRC/go/src/html
go mod init htmlPackage
go mod tidy
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes
go get github.com/AdamKorcz/go-118-fuzz-build/utils
compile_go_fuzzer htmlPackage Fuzz fuzz_html_escape_unescape