Skip to content

Continuous Fuzzing Integration with Fuzzit - #12771

Merged
evverx merged 1 commit into
systemd:masterfrom
fuzzitdev:continuous-fuzzing
Jun 14, 2019
Merged

evverx merged 1 commit into
systemd:masterfrom
fuzzitdev:continuous-fuzzing

Conversation

@yevgenypats

@yevgenypats yevgenypats commented Jun 11, 2019 •

Copy link
Copy Markdown
Contributor

Continuous Fuzzing integration with Fuzzit.

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.

@evverx I think it's ready for review.

@evverx

evverx commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

@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 evverx added ci do-not-merge 💣 fuzzing Implementation of fuzzers and fixes for stuff found through fuzzing labels Jun 11, 2019
@yevgenypats

Copy link
Copy Markdown
Contributor Author

@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.

@evverx

evverx commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

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.

@evverx

evverx commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

@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.

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. will do.

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add TRAVIS_PULL_REQUEST somewhere to make it easier to figure out what's going on. Currently it seems to be hard to match jobs with PRs:
Screenshot 2019-06-11 at 15 15 56

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, easy. will do today.

@evverx

evverx commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

I'm looking at https://app.fuzzit.dev/admin/RxqRpGNXquIvqrmp4iJS/target/2ODbhEjfRF2AZtrUotMh/FJbQZ17ajuzuqewqYtot (where a sanity job finished without running the fuzz target)

INFO:root:/tmp/tmp_4uqwdtx
INFO:root:Downloading fuzzer...
INFO:root:downloading orgs/RxqRpGNXquIvqrmp4iJS/targets/2ODbhEjfRF2AZtrUotMh/jobs/FJbQZ17ajuzuqewqYtot/fuzzer.tar.gz
INFO:root:Downloading seed corpus...
INFO:root:downloading orgs/RxqRpGNXquIvqrmp4iJS/targets/2ODbhEjfRF2AZtrUotMh/seed.tar.gz
INFO:root:artifact doesnt exist. skipping...
INFO:root:downloading orgs/RxqRpGNXquIvqrmp4iJS/targets/2ODbhEjfRF2AZtrUotMh/corpus.tar.gz
INFO:root:artifact doesnt exist. skipping...
INFO:root:Syncing corpus from cloud
INFO:root:no files yet generated for sanity test. please run a fuzzing job first

Would it be possible to run fuzz targets 1000 times (with something like ./fuzzer -runs=1000) if the corpus isn't available yet just to make sure they're in good shape?

@evverx

evverx commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

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.

@evverx

evverx commented Jun 11, 2019 •

Copy link
Copy Markdown
Contributor

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 fuzz-unit-file started at 19:54:17 and stopped at 20:55:42. Initially, I thought it had something to do with the update you mentioned on Slack. Though having looked at radare, it doesn't seem to be the case and there sanity jobs run the fuzzer against a set of files while fuzz-unit-file just kept fuzzing for a while. It's probably something worth looking into so I haven't canceled anything to make it easier to figure out what is going on.

@yevgenypats yevgenypats changed the title WIP: Continuous Fuzzing Integration with Fuzzit Continuous Fuzzing Integration with Fuzzit Jun 14, 2019
@yevgenypats

Copy link
Copy Markdown
Contributor Author

@evverx I think I fixed most of the bugs that we discussed and this is ready for review.

Comment thread README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will fix now for both questions.

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add export SANITIZER=address,undefined to build the fuzz targets with both ASan and UBsan?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The badge seems to be green even though fuzz-nspawn-oci is broken: Fuzzit Status.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@evverx

evverx commented Jun 14, 2019

Copy link
Copy Markdown
Contributor

To make sure the fuzz targets built locally are in sync with the fuzz targets on Fuzzit I ran

$ diff <(find ./out/ -maxdepth 1 -executable -type f | xargs -n1 basename | sort) <(./fuzzit-1.1 get targets | jq --raw-output '.target_name' | sort)
7d6
< fuzz-dhcp-server
11c10
< fuzz-journald-audit
---
> fuzz-journal-audit

Could you rename fuzz-journal-audit?

Before we start adding fuzz-dhcp-server, could you add a word or two to https://github.com/systemd/systemd/blob/master/docs/HACKING.md#fuzzers about what to do when new fuzz targets are introduced?

@evverx

evverx commented Jun 14, 2019

Copy link
Copy Markdown
Contributor

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 fuzzit-1.1 get targets | jq --raw-output '.target_name' | sort and then compare that list with the list of the fuzz targets in ./out.

@evverx

evverx commented Jun 14, 2019

Copy link
Copy Markdown
Contributor

In #12761 I also passed --ubsan_options=print_stacktrace=1:print_summary=1:halt_on_error=1 to fuzzit and, as far as I can tell, 5 fuzzers crashed:

root@4530dc7d4d52:/home/vagrant/systemd# UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 ./out/fuzz-bus-message /corpora/corpus/systemd/fuzz-bus-message/
INFO: Seed: 2973527184
INFO: Loaded 2 modules   (122191 inline 8-bit counters): 122160 [0x7faa6731b8f0, 0x7faa67339620), 31 [0x737d20, 0x737d3f),
INFO: Loaded 2 PC tables (122191 PCs): 122160 [0x7faa67339620,0x7faa67516920), 31 [0x511b90,0x511d80),
INFO:     4157 files found in /corpora/corpus/systemd/fuzz-bus-message/
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048575 bytes
INFO: seed corpus: files: 4157 min: 1b max: 1048575b total: 47634618b rss: 47Mb
../src/libsystemd/sd-bus/bus-message.c:3069:35: runtime error: addition of unsigned offset to 0x603000003650 overflowed to 0x60300000364f
    #0 0x7faa66a8f155 in buffer_peek /home/vagrant/systemd/build/../src/libsystemd/sd-bus/bus-message.c:3069:35
    #1 0x7faa66a43638 in bus_message_parse_fields /home/vagrant/systemd/build/../src/libsystemd/sd-bus/bus-message.c:5195:29
    #2 0x7faa66a3f52b in bus_message_from_malloc /home/vagrant/systemd/build/../src/libsystemd/sd-bus/bus-message.c:559:13
    #3 0x4fa834 in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/fuzz/fuzz-bus-message.c:30:13
    #4 0x43bf71 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:556:15
    #5 0x43b6a5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:472:3
    #6 0x43dcae in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:769:7
    #7 0x43df65 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3
    #8 0x42da59 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:815:6
    #9 0x453e22 in main /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:19:10
    #10 0x7faa651aa2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #11 0x420c39 in _start (/home/vagrant/systemd/out/fuzz-bus-message+0x420c39)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/libsystemd/sd-bus/bus-message.c:3069:35 in
MS: 0 ; base unit: 0000000000000000000000000000000000000000
0x6c,0xff,0x73,0x2,0x0,0x28,0x28,0x76,0x29,0x28,0x67,0x29,0x28,0x76,0x29,0x29,0x10,
l\xffs\x02\x00((v)(g)(v))\x10
artifact_prefix='./'; Test unit written to ./crash-901fadefeb29438f1be0b1abff2ccf6f2700d954
Base64: bP9zAgAoKHYpKGcpKHYpKRA=
root@4530dc7d4d52:/home/vagrant/systemd# UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 ./out/fuzz-dns-packet /corpora/corpus/systemd/fuzz-dns-packet/
INFO: Seed: 177709957
INFO: Loaded 2 modules   (132547 inline 8-bit counters): 122160 [0x7fe1f5d108f0, 0x7fe1f5d2e620), 10387 [0x7e55e0, 0x7e7e73),
INFO: Loaded 2 PC tables (132547 PCs): 122160 [0x7fe1f5d2e620,0x7fe1f5f0b920), 10387 [0x7e7e78,0x8107a8),
INFO:     4742 files found in /corpora/corpus/systemd/fuzz-dns-packet/
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 983043 bytes
INFO: seed corpus: files: 4742 min: 1b max: 983043b total: 9274245b rss: 49Mb
../src/resolve/resolved-dns-rr.c:683:24: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:66:33: note: nonnull attribute specified here
    #0 0x52b53b in dns_resource_record_payload_equal /home/vagrant/systemd/build/../src/resolve/resolved-dns-rr.c:683:24
    #1 0x54f17e in dns_answer_add /home/vagrant/systemd/build/../src/resolve/resolved-dns-answer.c:104:21
    #2 0x5199e1 in dns_packet_extract_answer /home/vagrant/systemd/build/../src/resolve/resolved-dns-packet.c:2277:29
    #3 0x5181ab in dns_packet_extract /home/vagrant/systemd/build/../src/resolve/resolved-dns-packet.c:2313:13
    #4 0x4fba14 in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/fuzz/fuzz-dns-packet.c:22:16
    #5 0x43cf61 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:556:15
    #6 0x43c695 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:472:3
    #7 0x43ec9e in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:769:7
    #8 0x43ef55 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3
    #9 0x42ea49 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:815:6
    #10 0x454e12 in main /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:19:10
    #11 0x7fe1f3b9f2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #12 0x421c29 in _start (/home/vagrant/systemd/out/fuzz-dns-packet+0x421c29)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/resolve/resolved-dns-rr.c:683:24 in
MS: 0 ; base unit: 0000000000000000000000000000000000000000
0xc3,0xff,0x3,0x0,0x0,0x0,0x0,0x8,0x0,0x7c,0xd,0x0,0x0,0x20,0x0,0x0,0x0,0x31,0xff,0x1f,0xff,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x2a,0x22,0xff,0x5b,0x0,0x0,
\xc3\xff\x03\x00\x00\x00\x00\x08\x00|\x0d\x00\x00 \x00\x00\x001\xff\x1f\xff\x00\x00\x00 \x00\x00\x00*\"\xff[\x00\x00
artifact_prefix='./'; Test unit written to ./crash-3fc5726da38f7827a3a5e17b33c36c4e6bd41385
Base64: w/8DAAAAAAgAfA0AACAAAAAx/x//AAAAIAAAACoi/1sAAA==
root@4530dc7d4d52:/home/vagrant/systemd# UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 ./out/fuzz-json /corpora/corpus/systemd/fuzz-json/
INFO: Seed: 2957938526
INFO: Loaded 2 modules   (122178 inline 8-bit counters): 122160 [0x7f1c65b0e8f0, 0x7f1c65b2c620), 18 [0x736c30, 0x736c42),
INFO: Loaded 2 PC tables (122178 PCs): 122160 [0x7f1c65b2c620,0x7f1c65d09920), 18 [0x5115b0,0x5116d0),
INFO:     2570 files found in /corpora/corpus/systemd/fuzz-json/
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
INFO: seed corpus: files: 2570 min: 1b max: 1048576b total: 29066865b rss: 46Mb
../src/shared/json.c:1671:20: runtime error: member access within address 0x60400005b5d0 with insufficient space for an object of type 'JsonVariant' (aka 'struct JsonVariant')
0x60400005b5d0: note: pointer points here
 03 00 00 3e  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^
    #0 0x7f1c64ff068a in json_variant_copy /home/vagrant/systemd/build/../src/shared/json.c:1671:20
    #1 0x7f1c64feec4c in json_variant_set_source /home/vagrant/systemd/build/../src/shared/json.c:1744:13
    #2 0x7f1c64fe086b in json_parse_internal /home/vagrant/systemd/build/../src/shared/json.c:2593:32
    #3 0x7f1c64fe341a in json_parse_file /home/vagrant/systemd/build/../src/shared/json.c:2651:16
    #4 0x4fa5e9 in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/fuzz/fuzz-json.c:21:13
    #5 0x43bda1 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:556:15
    #6 0x43b4d5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:472:3
    #7 0x43dade in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:769:7
    #8 0x43dd95 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:792:3
    #9 0x42d889 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:815:6
    #10 0x453c52 in main /build/llvm-toolchain-snapshot-9~svn361308/projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:19:10
    #11 0x7f1c6399d2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #12 0x420a69 in _start (/home/vagrant/systemd/out/fuzz-json+0x420a69)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/shared/json.c:1671:20 in
MS: 0 ; base unit: 0000000000000000000000000000000000000000
0x7b,0x7d,
{}
artifact_prefix='./'; Test unit written to ./crash-bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f
Base64: e30=

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)

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :-)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}.

Comment thread travis-ci/managers/fuzzit.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@evverx

evverx commented Jun 14, 2019

Copy link
Copy Markdown
Contributor

@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.
@evverx

evverx commented Jun 14, 2019

Copy link
Copy Markdown
Contributor

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

@evverx
evverx merged commit 53a42e6 into systemd:master Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci fuzzing Implementation of fuzzers and fixes for stuff found through fuzzing

Development

Successfully merging this pull request may close these issues.

2 participants