diff --git a/projects/go-json-iterator/Dockerfile b/projects/go-json-iterator/Dockerfile index 57cac6d56..78972b689 100644 --- a/projects/go-json-iterator/Dockerfile +++ b/projects/go-json-iterator/Dockerfile @@ -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 diff --git a/projects/go-json-iterator/build.sh b/projects/go-json-iterator/build.sh index a6b121221..476de37d8 100755 --- a/projects/go-json-iterator/build.sh +++ b/projects/go-json-iterator/build.sh @@ -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 diff --git a/projects/syzkaller/Dockerfile b/projects/syzkaller/Dockerfile index a02296570..983c8faca 100644 --- a/projects/syzkaller/Dockerfile +++ b/projects/syzkaller/Dockerfile @@ -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/ diff --git a/projects/syzkaller/build.sh b/projects/syzkaller/build.sh index b36f446d2..2977b577a 100755 --- a/projects/syzkaller/build.sh +++ b/projects/syzkaller/build.sh @@ -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