summaryrefslogtreecommitdiffstats
path: root/test/fuzz/fuzz-systemctl-parse-argv (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fuzz: rename long samplesZbigniew Jędrzejewski-Szmek2023-05-181-0/+0
| | | | With those long filenames, output doesn't fit on the terminal.
* systemctl: refuse to acquire dbus connection with --globalYu Watanabe2023-03-131-0/+0
| | | | | | | | | Maybe, better to check the runtime scope each verb for better log message, but this is a good start point to not trigger assertion. Fixes oss-fuzz#56915 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56915). Fixes #26402 and #26754.
* tree-wide: change --kill-who to --kill-whomZbigniew Jędrzejewski-Szmek2022-08-261-0/+0
| | | | | | | | | | | getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and people can use --kill-who (or even shorter abbreviations). English is flexible, so in common speach people would use both forms, even if "whom" is technically more correct. The advantage of using the longer form in the code is that we effectively allow both forms, so we stop punishing people who DTGCT¹, but still allow people to use the spoken form if they prefer. 1. Do the gramatically correct thing
* systemctl: unset const char* arguments in static destructorsZbigniew Jędrzejewski-Szmek2021-05-311-0/+0
| | | | | | | | | | | | | | | | | | | | | | | When fuzzing, the following happens: - we parse 'data' and produce an argv array, - one of the items in argv is assigned to arg_host, - the argv array is subsequently freed by strv_freep(), and arg_host has a dangling symlink. In normal use, argv is static, so arg_host can never become a dangling pointer. In fuzz-systemctl-parse-argv, if we repeatedly parse the same array, we have some dangling pointers while we're in the middle of parsing. If we parse the same array a second time, at the end all the dangling pointers will have been replaced again. But for a short time, if parsing one of the arguments uses another argument, we would use a dangling pointer. Such a case occurs when we have --host=… --boot-loader-entry=help. The latter calls acquire_bus() which uses arg_host. I'm not particularly happy with making the code more complicated just for fuzzing, but I think it's better to resolve this, even if the issue cannot occur in normal invocations, than to deal with fuzzer reports. Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31714.
* fuzz-systemctl-parse-argv: add "telinit" to the argv[0] listZbigniew Jędrzejewski-Szmek2021-02-221-0/+0
|
* basic/alloc-util: also reset the cleaned-up variable in freep()Zbigniew Jędrzejewski-Szmek2021-02-191-0/+0
| | | | | | | | | | | | | | | | | freep() has it's own definition, so I missed it in fd421c4adc7406de02e03e2f7ceede2cc6e1d9d4. Again, there is a small growth, but the compiler should be able to optimize it away: -Dbuildtype=debug: -rwxrwxr-x 1 zbyszek zbyszek 4106816 Feb 19 12:52 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 7492952 Feb 19 12:52 build/src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 zbyszek zbyszek 4472624 Feb 19 12:53 build/systemd -rwxrwxr-x 1 zbyszek zbyszek 4107056 Feb 19 13:03 build/libsystemd.so.0.30.0 -rwxrwxr-x 1 zbyszek zbyszek 7493480 Feb 19 13:03 build/src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 zbyszek zbyszek 4472760 Feb 19 13:03 build/systemd Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31055.
* Merge pull request #18596 from keszybz/systemctl-quiet-legendLennart Poettering2021-02-171-0/+0
|\ | | | | systemctl: hide legends with --quiet, allow overriding
| * systemctl: hide legends with --quiet, allow overridingZbigniew Jędrzejewski-Szmek2021-02-171-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | --no-legend is replaced by --legend=no. --quiet now implies --legend=no, but --legend=yes may be used to override that. --quiet controls hints and warnings and such, and --legend controls just the legends. I think it makes sense to allow both to controlled independently, in particular --quiet --legend makes sense when using systemctl in a script to provide some user-visible output. Fixes #18560.
* | fuzz-systemctl-parse-argv: call static destuctorsZbigniew Jędrzejewski-Szmek2021-02-161-0/+0
|/ | | | | | With all the preparatory work in previous PRs, we can now call static destructors repeatedly without issue. We need to do it here so that global variables allocated during parsing are properly freed.
* fuzz-systemctl-parse-argv: add argv[0] values to corpusZbigniew Jędrzejewski-Szmek2021-02-151-0/+0
|
* fuzz-systemctl-parse-argv: a new fuzzerZbigniew Jędrzejewski-Szmek2021-02-091-0/+0
Does what the name suggests. Obviously inspired by sudoers, but note that our tools are not supposed to be installed suid, so there is no privilege boundary to cross here.