[PATCH] D70738: [libFuzzer] Add custom output function

Manish Goregaokar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 08:15:35 PST 2019


Manishearth added a comment.



> Sorry, I wasn't clear. I mean if you write fuzz targets with the `getenv()` based solution I proposed, `cargo fuzz` can be extended so that it will execute the crashing input with the necessary env variable set. That way we achieve the following:

No, it cannot, libFuzzer sets a main function at link time, this function cannot be overridden at runtime through an environment variable. So no matter what you do, if you execute this binary, it will pick some random input and start fuzzing. There doesn't seem to be a way for the fuzz target to prevent that, the only thing you can do is compile two separate binaries, which is trickier to do in the setup we have.

> 3. instead of defining a new function, users can inject the printing code anywhere under `if getenv()` condition

We don't want users to have to deal with this, it's supposed to be a smooth, invisible API

> Sorry, I wasn't clear. I mean if you write fuzz targets with the getenv() based solution I proposed, cargo fuzz can be extended so that it will execute the crashing input with the necessary env variable set. That way we achieve the following:

It's going to get printed on each fuzz run, though, which may not be desirable.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70738/new/

https://reviews.llvm.org/D70738





More information about the llvm-commits mailing list