summaryrefslogtreecommitdiffstats
path: root/src/udev/fuzz-udev-rules.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fuzz: unify logging setupFrantisek Sumsal2023-10-191-2/+1
| | | | | | | | | | Make sure we don't log anything when running in "fuzzing" mode. Also, when at it, unify the setup logic into a helper, pretty similar to the test_setup_logging() one. Addresses: - https://github.com/systemd/systemd/pull/29558#pullrequestreview-1676060607 - https://github.com/systemd/systemd/pull/29558#discussion_r1358940663
* udev-rules: move udev_check_rule_line() invocationDmitry V. Levin2023-03-271-1/+1
| | | | | | | | | Move udev_check_rule_line() invocation from udev_rule_file_get_issues() to udev_rules_parse_file(), invoke udev_check_rule_line() only when udev_rules_parse_file() is called by udevadm verify. Subsequent commits are going to perform more checks invoked from udev_rules_parse_file().
* udev-rule: rework logging about udev rulesYu Watanabe2023-03-131-4/+3
| | | | | | | | | | | | | | | This makes the loggers take the most relevant object, i.e. when applying udev rules to a device, the loggers take sd_device and UdevRuleToken object, and when parsing udev rules, they take UdevRuleLine or UdevRuleFile object. To achieve that, this drops 'iterators' in UdevRules or friends named `current_file` or so. Instead of that, each object now has its parent object, e.g. UdevRuleToken.rule_line that references the UdevRuleLine object the token belonging to. And each function previously took UdevRules object now takes the most relevant object, e.g. UdevRuleToken. Solves the discussion in https://github.com/systemd/systemd/pull/26698#discussion_r1129261193.
* fuzzers: ignore size limits when compiled standaloneZbigniew Jędrzejewski-Szmek2022-05-121-1/+1
| | | | | This way we can still call fuzzers on old samples, but oss-fuzz will not waste its and our time finding overly large inputs.
* fuzzers: add input size limits, always configure limits in two waysYu Watanabe2022-05-121-0/+3
| | | | | | | | | | | | | | | | | Without the size limits, oss-fuzz creates huge samples that time out. Usually this is because some of our code has bad algorithmic complexity. For data like configuration samples we don't need to care about this: non-rogue configs are rarely more than a few items, and a bit of a slowdown with a few hundred items is acceptable. This wouldn't be OK for processing of untrusted data though. We need to set the limit in two ways: through .options and in the code. The first because it nicely allows libFuzzer to avoid wasting time, and the second because fuzzers like hongfuzz and afl don't support .options. While at it, let's fix an off-by-one (65535 is the largest offset for a power-of-two size, but we're checking the size here). Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
* udev: stop to use LOG_REALM_UDEVYu Watanabe2021-01-251-4/+2
| | | | | | | | Before this commit, udevd is built with LOG_REALM=LOG_REALM_UDEV. However, log level specified by e.g. environment variable or kernel command line option are also passed to LOG_REALM_SYSTEMD. So, the maximum log level for the two realms are always equivalent, and it is not necessary to specify the build option. Hence drop it.
* fuzzers: move several fuzzersYu Watanabe2021-01-181-0/+36