Repository navigation
Continuous Fuzzing Integration with Fuzzit - #12771
Conversation
|
@yevgenypats thank you! To get started I'm going to create a target on Fuzzit with the corpus OSS-Fuzz has been accumulating for over half a year. Before I screw something up (which already happened in #12761 (comment) :-)), I'm wondering what is the right way to pack corpora passed via the "--seed" option. |
|
@evverx I think it's best to upload the seed corpus via the UI because it's a one time upload we don't need to upload it every time we start a job. |
|
To download all the corpora from OSS-Fuzz I need an API key and the only machine where the key is currently stored is kind of under a rock with no UI whatsoever (it blinks though :-)). I think I can download them via my account linked to OSS-Fuzz but I've never tried that so it might take a while. Anyway, it looks like you've already created 25 fuzz targets, which I guess should be enough to get the ball rolling. |
|
@yevgenypats yesterday I sent a fuzzer I built locally to Fuzzit and it failed there with INFO:root:/tmp/tmp6u_7rem9
INFO:root:Downloading fuzzer...
INFO:root:downloading orgs/X0gD7RDqzbNaqh4XUvUn/targets/qHXGJqipOXhjtWa8lAB1/jobs/TB2SxcCbXZDAAbMj6SPB/fuzzer.tar.gz
INFO:root:Downloading seed corpus...
INFO:root:downloading orgs/X0gD7RDqzbNaqh4XUvUn/targets/qHXGJqipOXhjtWa8lAB1/seed.tar.gz
INFO:root:artifact doesnt exist. skipping...
INFO:root:Syncing corpus from cloud
INFO:root:downloading orgs/X0gD7RDqzbNaqh4XUvUn/targets/qHXGJqipOXhjtWa8lAB1/corpus.tar.gz
INFO:root:artifact doesnt exist. skipping...
INFO:root:Running fuzzer for 1hr...
./fuzzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.26' not found (required by ./fuzzer)
./fuzzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./fuzzer)
INFO:root:fuzzer exited with 1
INFO:root:exiting successfully...
./fuzzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.27' not found (required by ./fuzzer)
./fuzzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by ./fuzzer)so I ended up downloading the "gcr.io/fuzzit-public/builders:llvm9.v1" image and building the fuzzer in that environment to avoid the mismatch. I'm not sure whether it's the right approach (I kind of borrowed it from radareorg/radare2@8958524) but I think we should somehow make sure that the build environment is compatible with the runtime environment. |
There was a problem hiding this comment.
Could you add a comment about why we decided to keep it public and why in general given threat modelling :-) it's safe to avoid answering the same questions over and over again?
There was a problem hiding this comment.
Currently because we want Fuzzit to run sanity jobs on every pull-request we can't use travis secrets as they are not exposed to pull-request and this is why we use this key in exposed form. The key is a create only key so it doesn't have permission to read sensitive data from the Fuzzit project.
There was a problem hiding this comment.
Sorry. My comment wasn't clear enough. What I was trying to say is that I think the comment should be added to the script itself right before export FUZZIT_API_KEY.
There was a problem hiding this comment.
Got it. will do.
There was a problem hiding this comment.
Sure, easy. will do today.
|
I'm looking at https://app.fuzzit.dev/admin/RxqRpGNXquIvqrmp4iJS/target/2ODbhEjfRF2AZtrUotMh/FJbQZ17ajuzuqewqYtot (where a sanity job finished without running the fuzz target) Would it be possible to run fuzz targets 1000 times (with something like |
|
Another option would be to mark sanity jobs as failed if fuzz targets haven't been run. Though I can imagine scenarios where it's not desirable. Maybe the "skipped" state would help to figure out what's happened without looking at the logs. |
|
Before I forget, I uploaded corpora for a few targets via the web interface and restarted Travis CI to start sanity jobs. I'm not sure why but it took about an hour for some of them to finish. For example, judging by https://app.fuzzit.dev/admin/RxqRpGNXquIvqrmp4iJS/target/RmD47BxVRbAZlq07XW30/qDSSIP8DTybGDh10rHyI |
|
@evverx I think I fixed most of the bugs that we discussed and this is ready for review. |
There was a problem hiding this comment.
Looks like the url points to localhost (which I assume was used for debugging). Could you change it to app.fuzzit.dev?
Just to be sure, does this badge show the status of fuzz-bus-label only? Is there a way to show the global status, which I think should be "green" when all the fuzz targets are green?
There was a problem hiding this comment.
Yes, will fix now for both questions.
There was a problem hiding this comment.
Could you add export SANITIZER=address,undefined to build the fuzz targets with both ASan and UBsan?
There was a problem hiding this comment.
Thank you! The badge seems to be green even though fuzz-nspawn-oci is broken: .
There was a problem hiding this comment.
Yes, The badge is not fully baked. I'll fix in the future but this is only in the Backend code. The URL can be stayed the same. BTW - fuzz-nspawn is really broken we can discuss this via slack.
|
To make sure the fuzz targets built locally are in sync with the fuzz targets on Fuzzit I ran Could you rename Before we start adding |
|
It would probably be great if we could come up with an automatic way to make sure that the fuzzers are in sync. In principle we could run something like |
|
In #12761 I also passed
I'll try to reproduce those with the latest clang (which is used on OSS-Fuzz, where those fuzzers don't crash as far as I know) |
There was a problem hiding this comment.
It seems 5 fuzz targets are missing. Could you run something like
./fuzzit-1.1 get targets | jq --raw-output '.target_name + " " + .id' | sort | perl -alne 'printf("./fuzzit c job \${FUZZIT_ARGS} %s %s ./out/%s \${FUZZIT_ADDITIONAL_FILES}\n", $F[0] eq q/fuzz-nspawn-oci/ ? q/--asan_options "quarantine_size_mb=10"/ : "", $F[1], $F[0])'
to regenerate the list of commands:
./fuzzit c job ${FUZZIT_ARGS} 2ODbhEjfRF2AZtrUotMh ./out/fuzz-bus-label ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} vbYVccyWoDdgqzrQeln8 ./out/fuzz-bus-message ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} 7ubB4DVu2EiYgPVtRUNV ./out/fuzz-calendarspec ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} S0dGMaaGwkvsLc0IqIJ7 ./out/fuzz-catalog ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} X7qIoGLAoBgjVf19SfvY ./out/fuzz-compress ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} KH6VEpV0ZoWynASJHm8z ./out/fuzz-dhcp6-client ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} ezQIlJWCX3xPUJdhLnWM ./out/fuzz-dhcp-server ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} YAfecldFs2xaXn0Ws1BE ./out/fuzz-dns-packet ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} 6AdGwIiI3l1Edu9V4fvF ./out/fuzz-env-file ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} cXCm75EhdDf5t2sSBLRC ./out/fuzz-hostname-util ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} P1MpkewCNQCYLdMFggnU ./out/fuzz-journald-audit ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} 9T5He9cANxHTBLaBURpz ./out/fuzz-journald-kmsg ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} d8lokp0LCLYgQwI7vyx6 ./out/fuzz-journald-native-fd ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} qCWFcENjlfWJX0Q3cIOT ./out/fuzz-journald-native ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} 62XnUyWTLAvIRh1vFkEw ./out/fuzz-journald-stream ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} ge3eTzephghWD3Stw2TE ./out/fuzz-journald-syslog ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} pzrzgLQY2cG8Iexb0tOt ./out/fuzz-journal-remote ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} nPIt1SCDkGkSFDth5RlG ./out/fuzz-json ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} 8tbrzwxsaIPalIRBHtK8 ./out/fuzz-link-parser ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} udjVYJfH4N01vaHNF5Kv ./out/fuzz-lldp ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} bgRZAE9E5uXRbUX76tId ./out/fuzz-ndisc-rs ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} MZNs1JG5UQstaIvfHYgb ./out/fuzz-netdev-parser ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} eoc9rbm2jKqIEg6Kdonv ./out/fuzz-network-parser ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} --asan_options "quarantine_size_mb=10" 8D0NrVtSwTpl23a9k0vv ./out/fuzz-nspawn-oci ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} cbgsYEyX6776MHFotO9O ./out/fuzz-nspawn-settings ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} s7d3LuRbkETCPSyxUvW8 ./out/fuzz-time-util ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} BRaEBuU7QVlSp1HOjlDb ./out/fuzz-udev-database ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} DcE70rAA2mhrxdyBRH90 ./out/fuzz-udev-rules ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} RmD47BxVRbAZlq07XW30 ./out/fuzz-unit-file ${FUZZIT_ADDITIONAL_FILES}
./fuzzit c job ${FUZZIT_ARGS} nU0lRNNkQrXirDMNOpR1 ./out/fuzz-varlink ${FUZZIT_ADDITIONAL_FILES}
There was a problem hiding this comment.
Could you add a comment about why quarantine_size_mb=10 is used here? I don't think it's obvious :-) I'm pretty sure I'll forget what it is in a couple of days :-)
There was a problem hiding this comment.
By the way, I think it would make sense to pass quarantine_size_mb=10 to all the fuzz targets. I'd add it to ${FUZZIT_ARGS}.
There was a problem hiding this comment.
I'm not sure ${TRAVIS_BRANCH} is helpful here when PRs are opened. In our case it's almost always "master". Maybe, it would make sense to use something like PR-${TRAVIS_PULL_REQUEST} in PRs and fall back to ${TRAVIS_BRANCH} if ${TRAVIS_PULL_REQUEST} is "false" (according to https://docs.travis-ci.com/user/environment-variables, it's "the pull request number if the current job is a pull request, “false” if it’s not a pull request"
|
@yevgenypats could you expand on what happens when "sanity" jobs fail? Does Fuzzit send notifications? If so, how does it decide who should receive them? |
includes two travis ci steps: 1) Every pull-request/push all fuzzing targets will do a quick sanity run on the generated corpus and crashes (via Fuzzit) 2) On a daily basis the fuzzing targets will be compiled (from master) and will and their respectible fuzzing job on Fuzzit will be updated to the new binary.
|
Since I'm not sure how flaky our fuzzers are on Fuzzit we decided to send notifications to me (or, more precisely, to the administrators of the systemd organization on Fuzzit (where I'm the only member)) for the time being so as not to bother contributors |

Continuous Fuzzing integration with Fuzzit.
includes two travis ci steps:
sanity run on the generated corpus and crashes (via Fuzzit)
master) and will and their respectible fuzzing job on Fuzzit
will be updated to the new binary.
@evverx I think it's ready for review.