Fuzzing: Instrument with new sanitizers
Signed-off-by: AdamKorcz <adam@adalogics.com>
This commit is contained in:
parent
f4095a6876
commit
e7c593edd0
@ -67,7 +67,7 @@ func FuzzApply(data []byte) int {
|
|||||||
// that targets archive.ImportIndex()
|
// that targets archive.ImportIndex()
|
||||||
func FuzzImportIndex(data []byte) int {
|
func FuzzImportIndex(data []byte) int {
|
||||||
f := fuzz.NewConsumer(data)
|
f := fuzz.NewConsumer(data)
|
||||||
tarBytes, err := f.TarBytes()
|
tarBytes, err := f.GetBytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
2
contrib/fuzz/fuzz_FuzzImportIndex.dict
Normal file
2
contrib/fuzz/fuzz_FuzzImportIndex.dict
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"oci-layout"
|
||||||
|
"manifest.json"
|
3
contrib/fuzz/fuzz_FuzzImportIndex.options
Normal file
3
contrib/fuzz/fuzz_FuzzImportIndex.options
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[libfuzzer]
|
||||||
|
max_len = 1500000
|
||||||
|
len_control = 0
|
@ -38,6 +38,10 @@ compile_fuzzers() {
|
|||||||
done
|
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
|
apt-get update && apt-get install -y wget
|
||||||
cd $SRC
|
cd $SRC
|
||||||
wget --quiet https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
|
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
|
cd integration/client
|
||||||
|
|
||||||
compile_fuzzers '^func FuzzInteg.*data' compile_go_fuzzer vendor
|
compile_fuzzers '^func FuzzInteg.*data' compile_go_fuzzer vendor
|
||||||
|
|
||||||
|
cp $SRC/containerd/contrib/fuzz/*.options $OUT/
|
||||||
|
cp $SRC/containerd/contrib/fuzz/*.dict $OUT/
|
||||||
|
Loading…
Reference in New Issue
Block a user