Fuzzing: Instrument with new sanitizers

Signed-off-by: AdamKorcz <adam@adalogics.com>
This commit is contained in:
AdamKorcz 2022-09-15 22:39:35 +01:00
parent f4095a6876
commit e7c593edd0
4 changed files with 13 additions and 1 deletions

View File

@ -67,7 +67,7 @@ func FuzzApply(data []byte) int {
// that targets archive.ImportIndex()
func FuzzImportIndex(data []byte) int {
f := fuzz.NewConsumer(data)
tarBytes, err := f.TarBytes()
tarBytes, err := f.GetBytes()
if err != nil {
return 0
}

View File

@ -0,0 +1,2 @@
"oci-layout"
"manifest.json"

View File

@ -0,0 +1,3 @@
[libfuzzer]
max_len = 1500000
len_control = 0

View File

@ -38,6 +38,10 @@ compile_fuzzers() {
done
}
# This is from https://github.com/AdamKorcz/instrumentation
cd $SRC/instrumentation
go run main.go $SRC/containerd/images
apt-get update && apt-get install -y wget
cd $SRC
wget --quiet https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
@ -89,3 +93,6 @@ sed -i 's/\/run\/containerd-test/\/tmp\/containerd-test/g' $SRC/containerd/integ
cd integration/client
compile_fuzzers '^func FuzzInteg.*data' compile_go_fuzzer vendor
cp $SRC/containerd/contrib/fuzz/*.options $OUT/
cp $SRC/containerd/contrib/fuzz/*.dict $OUT/