Fix syzkaller to use go-fuzz. (#3646)

Fixes #3639.
This commit is contained in:
Abhishek Arya 2020-04-14 15:48:08 -07:00 committed by GitHub
parent e5c7c7099b
commit 896ed726e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -18,7 +18,7 @@ FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER taowen@gmail.com
RUN go get github.com/json-iterator/go
RUN mkdir $GOPATH/src/fuzz
COPY fuzz_json.go $GOPATH/src/fuzz
RUN mkdir fuzz
COPY fuzz_json.go fuzz
COPY build.sh $SRC/
WORKDIR $GOPATH/src/fuzz
WORKDIR fuzz

View File

@ -28,4 +28,4 @@ function compile_fuzzer {
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -lpthread -o $OUT/$fuzzer
}
compile_fuzzer fuzz Fuzz fuzz_json
compile_fuzzer . Fuzz fuzz_json

View File

@ -22,6 +22,6 @@ RUN go get -u -d github.com/google/syzkaller/...
# Dependency for one of the fuzz targets.
RUN go get github.com/ianlancetaylor/demangle
RUN git clone --depth 1 https://github.com/google/syzkaller.git $GOPATH/src/syzkaller
WORKDIR $GOPATH/src/syzkaller
RUN git clone --depth 1 https://github.com/google/syzkaller.git
WORKDIR syzkaller
COPY build.sh $SRC/

View File

@ -22,16 +22,16 @@ function compile_fuzzer {
fuzzer=$3
# Instrument all Go files relevant to this fuzzer
go-fuzz-build -libfuzzer -func $function -o $fuzzer.a $path
go-fuzz -func $function -o $fuzzer.a $path
# Instrumented, compiled Go ($fuzzer.a) + fuzzing engine = fuzzer binary
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -lpthread -o $OUT/$fuzzer
}
compile_fuzzer syzkaller/pkg/compiler Fuzz compiler_fuzzer
compile_fuzzer syzkaller/prog/test FuzzDeserialize prog_deserialize_fuzzer
compile_fuzzer syzkaller/prog/test FuzzParseLog prog_parselog_fuzzer
compile_fuzzer syzkaller/pkg/report Fuzz report_fuzzer
compile_fuzzer ./pkg/compiler Fuzz compiler_fuzzer
compile_fuzzer ./prog/test FuzzDeserialize prog_deserialize_fuzzer
compile_fuzzer ./prog/test FuzzParseLog prog_parselog_fuzzer
compile_fuzzer ./pkg/report Fuzz report_fuzzer
# This target is way too spammy and OOMs very quickly.
# compile_fuzzer ./tools/syz-trace2syz/proggen Fuzz trace2syz_fuzzer