-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
attempt at oss-fuzz integration #1476
Conversation
0001-fuzz-makefile-adjustments.patch Here's my initial take at adding support for configure / make to build the test code in the The building of the test apps doesn't quite work but it wasn't clear to me exactly how they should get built so I couldn't fix that completely. What compile and linking should get done for each of the fuzz programs? |
The fuzz apps, aren't strictly apps. They are static libraries. LibFuzzer will provide the main file and loop though the With your patch, I could build the individual test apps with I also realize that while I tried to explain what oss-fuzz expects, I should have linked to the original sources. I am currently looking at their integration guide and the existing integration |
I looked at the existing integration just now. Shouldn't we just make the makefile link each fuzz app with libcurl and use -lFuzzingEngine to create the outputs?
It builds, or tries to build, each app that is listed in the |
I played around a little more with the addition below, but I get funny link errors so it's not quite there yet:
|
-LIBS = $(BLANK_AT_MAKETIME)
+LIBS = -lpthread -lFuzzer It seems that other oss-fuzz build scripts want to link against the fuzzer (in contrast to doing it in the target). I'm not sure about the pros & cons, just a thing I observed. |
I'm trying to make this link using the already built libcurl and using the libFuzzer I have installed as part of clang, I don't have any particular opinions exactly how that is done as long as the test applications end up working! They don't right now and I'm not sure how it is supposed to work really... Currently this setup causes this set of errors:
Alternatively, I use this:
which instead leads to other complaints:
|
Unfortunately I'm pretty sure this is what it says. If the library is static (ie you want a static foo in dynamic libcurl) then rebuild static foo with -fPIC or use static libcurl.
This is likely because you didn't turn off static afterwards, so basically LIBS becomes something like |
That was with a static libcurl, but not all dependencies were static.
I don't care which. I want a working build and I don't have that. |
Ok. Well it says "can not be used when making a shared object" so I think a good place to start is examine the verbose output and find out what object it is. Also you might want to try |
Here's another take.
The patch currently points out the libFuzzer directory with a hard-coded path, which is a bit unfortunate but on my Debian system it isn't put in a path that the linker searches by default. The difference from before is that this works if we build with clang and we add libstdc++ and libm as explicit libs on the linker command line. |
I can't get the produced tools to actually do anything though so I guess there's still something missing:
|
@freddyb do you know if that is supposed to work or perhaps what we need to do to actually make some fuzzing happen? |
Re #1476 (comment) and #1476 (comment), I guess that e.g. |
Ah yes, with those flags it seems to run. Thanks a lot. I figure the next step is then to make sure it actually runs something useful... |
curl fuzzer hasn't found anything interesting, so i think the fuzz target might need improvements as well. |
Yes clearly! I suppose I should merge what we have so far to make it easier for others to help out here. |
Yeah, first step was to make Integration work for the curl folks and have it live in the repo. Next step, improving coverage. Sorry for being so unresponsive lately. Will pick this up again.
Am 15. Juni 2017 17:35:47 MESZ schrieb Abhishek Arya <notifications@github.com>:
…curl fuzzer hasn't found anything interesting, so i think the fuzz
target might need improvements.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#1476 (comment)
|
Thanks a ton, we are very excited to see this integration finally happening. |
Thanks @freddyb, this first take is now merged. |
This is a first attempt to integrate the oss-fuzz target into the curl repository.
oss-fuzz wants to be as build-system agnostic as possible, so the desired outcome is that oss-fuzz can do something along the lines of
This initial pull request takes the targets from the existing oss-fuzz code, and rewrites it into C89 that is up to curl's coding style guidelines (at least that's what I hope!).
That being said, I'd happy to expose some other functionality that is considered more worthwhile to test.
What this pull request is lacking, is proper build-system integration as I am quite inexperienced with the various "makes" (cmake, automake, etc.). Please review and advise how to proceed :)