Commit Graph

1 Commits

Author SHA1 Message Date
Hasnain Lakhani 4b5a47fe3b Add fuzzing support for proxygen (#2856)
This adds support for compiling and running the fuzzers present in the proxygen repository.
Right now there's only one fuzzer committed there, but this build script is generic
and will pull all of them in as we add more (if oss-fuzz integration proves fruitful).

Test plan is below - following https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally

I verified the base image builds:

    python infra/helper.py build_image proxygen

I built and verified the ASAN fuzzer works:

    python infra/helper.py build_fuzzers --sanitizer address proxygen
    python infra/helper.py check_build proxygen
    python infra/helper.py run_fuzzer proxygen ProxygenHTTP1xFuzzer

Similar thing for UBSAN:

    python infra/helper.py build_fuzzers --sanitizer undefined proxygen
    python infra/helper.py check_build proxygen
    python infra/helper.py run_fuzzer proxygen ProxygenHTTP1xFuzzer

Note the last one seemed to run ASAN build by default so I pulled out the command it runs and ran it manually:

    docker run --rm -i --privileged -e FUZZING_ENGINE=libfuzzer -e SANITIZER=undefined -e ARCHITECTURE=x86_64 -v /home/mhl/oss-fuzz/build/out/proxygen:/out -t gcr.io/oss-fuzz-base/base-runner test_all

I tested the coverage build:

    python infra/helper.py build_fuzzers --sanitizer coverage proxygen
    python infra/helper.py coverage proxygen ProxygenHTTP1xFuzzer

Note that this "runs" but threw some warnings which I will file a separate issue for.
It does generate the files though.

NOTE: I didn't run the MSAN build as I would have to figure out instrumenting all dependencies.
We can investigate that in a follow up.

Similarly, I haven't yet tried the dataflow build.

Note that I haven't tried testing this with the AFL build yet either. There were no instructions on the page (https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally) on how to do so -- if someone can mention them here I am happy to test that too before committing.
2019-09-19 16:32:39 -07:00