Commit Graph

29 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 56b560c263 fuzz-bus-message: add fuzzer for message parsing
As with other fuzzers, SYSTEMD_FUZZ_OUTPUT=1 and SYSTEMD_LOG_LEVEL=debug can be
used for debugging.
2018-10-02 11:09:05 +02:00
Evgeny Vereshchagin d89a400ed6 fuzz: add a fuzzer for dhcp6_client 2018-09-29 02:27:07 +00:00
Evgeny Vereshchagin 0f0a1dad7d tests: add a fuzzer for sd-ndisc 2018-09-26 16:39:03 +00:00
Zbigniew Jędrzejewski-Szmek 6d7c403324 tests: use a helper function to parse environment and open logging
The advantages are that we save a few lines, and that we can override
logging using environment variables in more test executables.
2018-09-14 09:29:57 +02:00
Evgeny Vereshchagin 231dca5579 tests: put fuzz_journald_processing_function in a .c file 2018-09-08 12:05:14 +02:00
Evgeny Vereshchagin 9cdea02db5 tests: add a fuzzer for server_process_native_message 2018-09-03 07:16:52 +00:00
Evgeny Vereshchagin b1bd453f36 tests: rework the code fuzzing journald
This should make it easier to add a new fuzzer without a lot of
duplication.
2018-09-03 06:46:24 +00:00
Evgeny Vereshchagin a70f343cac tests: add a rudimentary fuzzer for server_process_syslog_message (#9979) 2018-09-03 12:18:26 +09:00
Yu Watanabe f18edd8a0a tree-wide: add multiple inclusion guard 2018-06-25 13:04:59 +09:00
Zbigniew Jędrzejewski-Szmek d9b02e1697 tree-wide: drop copyright headers from frequent contributors
Fixes #9320.

for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
  git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
2018-06-20 11:58:53 +02:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00
Zbigniew Jędrzejewski-Szmek 6dbef3053d fuzz-journal-remote: write to /dev/null not stdout
This makes the fuzzing much more efficient. Optionally provide output is
$SYSTEMD_FUZZ_OUTPUT is set, which makes debugging of any failures much easier.

The case from 056129deb73df17ece4212db39d2ca0842d9a49c is still detected properly.
2018-05-31 14:30:23 +02:00
Zbigniew Jędrzejewski-Szmek bbdad08530 fuzz-journal-remote: try all output modes 2018-05-31 14:30:23 +02:00
Zbigniew Jędrzejewski-Szmek a38f7fec44 fuzz-journal-remote: a fuzzer for journal-remote over-the-wire input 2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek d6ea3b78a6 fuzz-unit-file: skip BOM (#8723)
Yet another false positive from ListenNetlink,
https://oss-fuzz.com/v2/testcase-detail/4908210742886400/7694.
2018-04-16 10:59:41 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Zbigniew Jędrzejewski-Szmek b834c6cee5 fuzz-unit-file: allow a space between variable name and "=" (#8670)
The parser allows that, so the check when to skip needs this too.

https://oss-fuzz.com/v2/issue/5106486364602368/7422
2018-04-06 11:36:17 +02:00
Zbigniew Jędrzejewski-Szmek 989290dbf1 fuzz-unit-file: add __has_feature(memory_sanitizer) when skipping ListenNetlink=
https://clang.llvm.org/docs/MemorySanitizer.html#id5 documents this
check as the way to detect MemorySanitizer at compilation time. We
only need to skip the test if MemorySanitizer is used.

Also, use this condition in cg_slice_to_path(). There, the code that is
conditionalized is not harmful in any way (it's just unnecessary), so remove
the FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION condition.

Fixes #8482.
2018-03-26 15:28:03 +02:00
Zbigniew Jędrzejewski-Szmek 483ed8a6a0 fuzz-unit-file: adjust check for ListenNetlink yet again
The test for ListenNetlink would abort the loop if a line longer then LINE_MAX
was encountered (read_line() returns -ENOBUFS in that case). Let's use the
the line length limit that the unit file parses uses.

https://oss-fuzz.com/v2/issue/5546208027213824/7094.
2018-03-26 10:42:19 +02:00
Zbigniew Jędrzejewski-Szmek af3865abf1 fuzz-unit-file: fix check if ListenNetlink is used
A line may contain leading spaces which we should skip.
Fixes https://oss-fuzz.com/v2/issue/5546208027213824/7049.
2018-03-21 13:16:52 +01:00
Zbigniew Jędrzejewski-Szmek bd0763b642 fuzz-unit-file: simply do not test ListenNetlink= at all
msan doesn't understand sscanf with %ms, so it falsely reports unitialized
memory. Using sscanf with %ms is quite convenient in
socket_address_parse_netlink(), so let's just not run the fuzzer for
ListenNetlink= at all for now. If msan is fixed, we can remove this.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6884
2018-03-18 21:05:43 +01:00
Zbigniew Jędrzejewski-Szmek d14829c8b7 fuzz-dhcp-server: fix name of options file 2018-03-11 16:33:59 +01:00
Zbigniew Jędrzejewski-Szmek b872843c4d fuzz: allow logging to be configured, disable in fuzz-unit-file
fuzz-unit-file generated too much logs about invalid config lines. This just
slows things down and fills the logs. If necessary, it's better to rerun the
interesting cases with SYSTEMD_LOG_LEVEL=debug.
2018-03-11 16:33:59 +01:00
Zbigniew Jędrzejewski-Szmek ec7a02ea54 Add fuzzer for unit file parser 2018-03-11 16:33:59 +01:00
Yu Watanabe db52db4afa fuzz: cast to void when return value is ignored 2018-01-22 09:58:29 +09:00
Yu Watanabe 0f3da640de fuzz: check return value
Closes CID #1385306 and #1385300.
2018-01-22 09:55:38 +09:00
Yu Watanabe 7444956723 fuzz: fix coding style 2018-01-22 09:54:30 +09:00
Jonathan Rudenberg 2bd37c5be2 fuzz: add DHCP server fuzzer 2018-01-19 21:48:14 -05:00
Jonathan Rudenberg 7db7d5b733 fuzz: add initial fuzzing infrastructure
The fuzzers will be used by oss-fuzz to automatically and
continuously fuzz systemd.

This commit includes the build tooling necessary to build fuzz
targets, and a fuzzer for the DNS packet parser.
2018-01-17 13:57:06 -05:00