Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fuzz target for oss-fuzz integration #1972

Merged
merged 1 commit into from
Jun 17, 2021
Merged

Conversation

catenacyber
Copy link
Contributor

@WardF would you agree to merge this fuzz target upstream ?
cf google/oss-fuzz#5389 (comment)

@catenacyber catenacyber requested a review from WardF as a code owner March 31, 2021 09:29
@CLAassistant
Copy link

CLAassistant commented Mar 31, 2021

CLA assistant check
All committers have signed the CLA.

@DennisHeimbigner
Copy link
Collaborator

Please provide some explanation about what this is attempting to do.

@catenacyber
Copy link
Contributor Author

Dennis, this adds a fuzz target to test netcdf, especially nc_open_mem
It will allow integration with oss-fuzz cf google/oss-fuzz#5389 and https://google.github.io/oss-fuzz/
It gets compiled if LIB_FUZZING_ENGINE environment variable is defined
For instance LIB_FUZZING_ENGINE=-fsanitize=fuzzer with clang
Is that clearer ?

@DennisHeimbigner
Copy link
Collaborator

ok, but I have a couple of other questions/comments:

  1. This is a reference to an environment variable I assume: $ENV{LIB_FUZZING_ENGINE}. Can we instead do this as a cmake option flag?
  2. Is this CMake only? Should we be adding this to Automake as well?

@catenacyber
Copy link
Contributor Author

ok, but I have a couple of other questions/comments:

  1. This is a reference to an environment variable I assume: $ENV{LIB_FUZZING_ENGINE}. Can we instead do this as a cmake option flag?

Indeed, it is an environment variable.
We can make a cmake option.
Do you want something like -DENABLE_FUZZ=ON ?
In this case, do you want to have the fuzzing driver to be set to -fsanitize=fuzzer (ie libfuzzer) by default and to the environment variable LIB_FUZZING_ENGINE if it is set ?
Oss-fuzz uses different values for LIB_FUZZING_ENGINE for libFuzzer, afl, and hongfuzz

  1. Is this CMake only? Should we be adding this to Automake as well?

It can be added as well.
Does it bring additional value ?

@DennisHeimbigner
Copy link
Collaborator

I was thinking more about having a FINDFUZZ package for cmake.
As for Automake, we tend to use that much more than cmake for our
testing. But I can certainly use the CMAke fixes to add it to automake.

Also, is this clang/llvm specific? We use gcc as a rule.

@catenacyber
Copy link
Contributor Author

having a FINDFUZZ package for cmake

I do not know that much about cmake...
Could you point me to some example ?

As for Automake, we tend to use that much more than cmake for our
testing.

I can also make it for automake instead of cmake...

Also, is this clang/llvm specific? We use gcc as a rule.

I think you can compile with gcc.
But if you want to have libfuzzer as a fuzzing engine, you need to compile it into a static library first

@catenacyber
Copy link
Contributor Author

Friendly ping @DennisHeimbigner
What is the status for this ?
Do I need to do something ?

@WardF
Copy link
Member

WardF commented Jun 14, 2021

@catenacyber Thank you for your patience, I'm reviewing this PR this morning and will either merge or follow up. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants