diff --git a/projects/mongo-go-driver/Dockerfile b/projects/mongo-go-driver/Dockerfile new file mode 100644 index 000000000000..1c073517f454 --- /dev/null +++ b/projects/mongo-go-driver/Dockerfile @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder-go + +RUN apt-get update && apt-get install -y make autoconf automake libtool + +RUN git clone --depth 1 https://github.com/mongodb/mongo-go-driver mongo-go-driver + +WORKDIR mongo-go-driver + +COPY build.sh $SRC/ diff --git a/projects/mongo-go-driver/build.sh b/projects/mongo-go-driver/build.sh new file mode 100755 index 000000000000..877110e1fee4 --- /dev/null +++ b/projects/mongo-go-driver/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash -eu +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +go get github.com/AdamKorcz/go-118-fuzz-build/testing +go run cmd/build-oss-fuzz-corpus/main.go $OUT/fuzz_decode_seed_corpus.zip + +mv bson/fuzz_test.go bson/fuzz.go +mv bson/bson_corpus_spec_test.go bson/bson_corpus_spec.go + +sed -i '/seedBSONCorpus/d' bson/fuzz.go + +compile_native_go_fuzzer go.mongodb.org/mongo-driver/bson FuzzDecode fuzz_decode diff --git a/projects/mongo-go-driver/project.yaml b/projects/mongo-go-driver/project.yaml new file mode 100644 index 000000000000..868e7b011dfb --- /dev/null +++ b/projects/mongo-go-driver/project.yaml @@ -0,0 +1,15 @@ +homepage: "https://github.com/mongodb/mongo-go-driver" +language: go +main_repo: "https://github.com/mongodb/mongo-go-driver" +fuzzing_engines: + - libfuzzer +sanitizers: + - address +primary_contact: "dbx-go@mongodb.com" +auto_ccs: + - qingyang.hu@mongodb.com + - matt.dale@mongodb.com + - kevin.albertson@mongodb.com + - preston.vasquez@mongodb.com +vendor_ccs: + - maxnair.dev@gmail.com