summaryrefslogtreecommitdiff
path: root/src/fuzz
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17478 from yuwata/split-network-internalYu Watanabe2020-11-271-1/+0
|\ | | | | libsystemd-network: split network-internal.c
| * meson: drop libsystemd_network from several binariesYu Watanabe2020-10-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the size of udevadm: Before: ``` $ ll udevadm -rwxrwxr-x 1 watanabe watanabe 1203800 Oct 29 01:36 udevadm ``` After: ``` $ ll udevadm -rwxrwxr-x 1 watanabe watanabe 1094384 Oct 29 01:38 udevadm ```
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-0934-34/+34
| |
* | udev: add fuzzer for udev_rule_parse_valueYu, Li-Yu2020-10-292-0/+35
|/
* fuzz-udev-rules: -ENOBUFS should be accepted tooZbigniew Jędrzejewski-Szmek2020-06-251-1/+6
| | | | | In udev_rules_load(), add a debug message. Otherwise there'd be no indication that parsing was aborted.
* fuzz-udev-rules: rewrite to not require root privilegesZbigniew Jędrzejewski-Szmek2020-06-231-83/+8
| | | | | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20142. It turns out we don't need to do all this preparatory work if we want to parse just one file.
* udev: split rules object creation and loadingZbigniew Jędrzejewski-Szmek2020-06-231-1/+1
| | | | | The only functional change is to downgrade the log line to avoid double logging.
* core: remove support for ".include" stanzaLennart Poettering2020-06-031-1/+1
| | | | | | | | | | Six years ago we declared it obsolete and removed it from the docs (c073a0c4a5ffbf6677dd6af02e7c7d59b2b901ab) and added a note about it in NEWS. Two years ago we add warning messages about it, indicating the feature will be removed (41b283d0f1f4abd85d0bbeeb7f71bb30f87cfab9) and mentioned it in NEWS again. Let's now kill it for good.
* conf-parser: return mtime in config_parse() and friendsLennart Poettering2020-06-021-4/+7
| | | | | | | | | | | | | This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86. Instead of reading the mtime off the configuration files after reading, let's do so before reading, but with the fd we read the data from. This is not only cleaner (as it allows us to save one stat()), but also has the benefit that we'll detect changes that happen while we read the files. This also reworks unit file drop-ins to use the common code for determining drop-in mtime, instead of reading system clock for that.
* xdg-autostart: fix two coverity found issuesLennart Poettering2020-05-281-2/+1
| | | | | Fixes: CID#1429003 Fixes: CID#1429004
* fuzz: Add an XDG desktop file fuzzerBenjamin Berg2020-05-272-0/+43
| | | | | | To test the XDG parser used by the xdg-autostart-generator. Co-authored-by: Evgeny Vereshchagin <evvers@ya.ru>
* ci: turn off FuzzBuzzEvgeny Vereshchagin2020-03-302-8/+0
| | | | I don't think anyone uses it.
* sd-bus: export sd_bus_message_dumpZbigniew Jędrzejewski-Szmek2020-01-231-1/+1
| | | | Fixes #14640.
* sd-bus: make dump flags publicZbigniew Jędrzejewski-Szmek2020-01-231-1/+1
|
* json: add flags parameter to json_parse_file(), for parsing "sensitive" dataLennart Poettering2019-12-021-1/+1
| | | | | | | This will call json_variant_sensitive() internally while parsing for each allocated sub-variant. This is better than calling it a posteriori at the end, because partially parsed variants will always be properly erased from memory this way.
* tree-wide: drop missing.hYu Watanabe2019-10-311-1/+0
|
* test: move {test,fuzz}-fido-id-desc.c into src/udev/fido_idYu Watanabe2019-10-312-28/+0
|
* udev: Add id program and rule for FIDO security tokensFabian Henneke2019-09-073-0/+34
| | | | | | | | | | | | | | Add a fido_id program meant to be run for devices in the hidraw subsystem via an IMPORT directive. The program parses the HID report descriptor and assigns the ID_SECURITY_TOKEN environment variable if a declared usage matches the FIDO_CTAPHID_USAGE declared in the FIDO CTAP specification. This replaces the previous approach of whitelisting all known security token models manually. This commit is accompanied by a test suite and a fuzzer target for the descriptor parsing routine. Fixes: #11996.
* journal: Make the output of --update-catalog deterministicDaniel Edgecumbe2019-09-061-2/+2
| | | | | | | | | | | | | The use of an unordered hashmap means that the output of 'journalctl --update-catalog' differs between runs despite there being no changes in the input files. By changing all instances of Hashmap to OrderedHashmap we fix this, and now the catalog is reproducible. Motivation: https://reproducible-builds.org Signed-off-by: Daniel Edgecumbe <git@esotericnonsense.com>
* udev: modernize udev-rules.cYu Watanabe2019-06-021-1/+1
| | | | | | | | | | | This does the following: - rename enum udev_builtin_cmd -> UdevBuiltinCmd - rename struct udev_builtin -> UdevBuiltin - move type definitions to udev-rules.h - move prototypes of functions defined in udev-rules.c to udev-rules.h - drop to use strbuf - propagate critical errors in applying rules, - drop limitation for number of tokens per line.
* fuzzer: add varlink fuzzerLennart Poettering2019-05-092-0/+135
|
* tests: hook up fuzz targets to FuzzBuzzEvgeny Vereshchagin2019-05-072-0/+8
|
* meson: make source files including nspawn-settings.h depend on libseccompFranck Bui2019-04-301-2/+2
| | | | | | | | | | | Since nspawn-settings.h includes seccomp.h, any file that includes nspawn-settings.h should depend on libseccomp so the correct header path where seccomp.h lives is added to the header search paths. It's especially important for distros such as openSUSE where seccomp.h is not shipped in /usr/include but /usr/include/libseccomp. This patch is similar to 8238423095ca54c48d9408a5da13e0325b31e6f6.
* Add fmemopen_unlocked() and use unlocked ops in fuzzers and some other testsZbigniew Jędrzejewski-Szmek2019-04-127-19/+16
| | | | This might make things marginially faster. I didn't benchmark though.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-272-0/+5
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* fuzz-nspawn-oci: add fuzzer for the oci bundle loaderZbigniew Jędrzejewski-Szmek2019-03-222-0/+33
|
* fuzz-calendarspec: actually run the second part of the fuzzerZbigniew Jędrzejewski-Szmek2019-03-161-1/+1
| | | | https://github.com/systemd/systemd/pull/11975#issuecomment-473467475
* Merge pull request #11975 from keszybz/fuzzer-fixes-nLennart Poettering2019-03-152-1/+3
|\ | | | | Fixes for a few fuzzer issues
| * fuzz: limit the maximum size of test inputs for a few parsersZbigniew Jędrzejewski-Szmek2019-03-122-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a few cases or reported issues which are about a timeout to parse the input in 25 s. In all cases, the input is a few hundred kb. We don't really care if the config parsers are super efficent, so let's set a limit on the input size to avoid triggering such issues. The parsers often contain quadratic algorithms. This is OK, because the numbers of elements are almost always very small in real use. Rewriting the code to use more complicated data structures to speed this up would not only complicate the code, but also pessimize behaviour for the overwhelmingly common case of small samples. Note that in all those cases, the input data is trusted. We care about memory correctness, and not not so much about efficiency. The size checks are done twice: using options for libfuzzer, and using an internal check for afl. Those should be changed together. I didn't use a define, because there is no easy mechanism to share the define between the two files.
* | util: split out memcmp()/memset() related calls into memory-util.[ch]Lennart Poettering2019-03-131-0/+1
|/ | | | Just some source rearranging.
* fuzz: add a fuzzer for time utilsFrantisek Sumsal2019-03-122-0/+32
|
* fuzz: add a fuzzer for calendarspecFrantisek Sumsal2019-03-122-0/+28
|
* fuzz: add nspawn-settings fuzzerFrantisek Sumsal2019-03-112-0/+33
|
* fuzz: add hostname-util fuzzerFrantisek Sumsal2019-03-112-0/+32
|
* fuzz: add env-file fuzzerFrantisek Sumsal2019-03-112-0/+35
|
* fuzz: add bus-label fuzzerFrantisek Sumsal2019-03-112-0/+22
|
* fuzz-dhcp6-client: avoid assertion failure on samples which dont fit in pipeYu Watanabe2019-03-042-0/+5
| | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11584.
* fuzz: do not assume the existence of /sys/class/net/loYu Watanabe2019-02-281-1/+2
| | | | Hopefully fixes oss-fuzz#13440.
* Merge pull request #11824 from keszybz/fuzzer-fixesLennart Poettering2019-02-266-1/+13
|\ | | | | Fuzzer fixes
| * fuzz-ndisc-rs: avoid assertion failure on samples which dont fit in pipeZbigniew Jędrzejewski-Szmek2019-02-262-0/+5
| | | | | | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11605.
| * fuzz-lldp: avoid assertion failure on samples which dont fit in pipeZbigniew Jędrzejewski-Szmek2019-02-262-0/+5
| | | | | | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11603.
| * fuzz-journal-stream: avoid assertion failure on samples which don't fit in pipeZbigniew Jędrzejewski-Szmek2019-02-262-1/+3
| | | | | | | | | | | | | | | | | | | | Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11587. We had a sample which was large enough that write(2) failed to push all the data into the pipe, and an assert failed. The code could be changed to use a loop, but then we'd need to interleave writes and sd_event_run (to process the journal). I don't think the complexity is worth it — fuzzing works best if the sample is not too huge anyway. So let's just reject samples above 64k, and tell oss-fuzz about this limit.
* | Merge pull request #11823 from keszybz/more-fuzz-coverageLennart Poettering2019-02-261-0/+1
|\ \ | |/ |/| More fuzz coverage
| * fuzz-unit-file: also run manager_dump()Zbigniew Jędrzejewski-Szmek2019-02-251-0/+1
| | | | | | | | This should increase coverage a bit.
* | fuzz: add fuzzer for udev databaseYu Watanabe2019-02-262-0/+29
|/
* udev: use typedef for struct udev_rulesZbigniew Jędrzejewski-Szmek2018-12-171-1/+1
|
* udev: make udev_rules_new() return a proper error codeZbigniew Jędrzejewski-Szmek2018-12-141-2/+2
|
* util: drop missing.h from socket-util.hYu Watanabe2018-12-061-1/+2
|
* util: drop missing.h from util.hYu Watanabe2018-12-041-0/+1
|
* util-lib: split out all temporary file related calls into tmpfiles-util.cLennart Poettering2018-12-022-3/+3
| | | | | | | | This splits out a bunch of functions from fileio.c that have to do with temporary files. Simply to make the header files a bit shorter, and to group things more nicely. No code changes, just some rearranging of source files.