Commit Graph

57719 Commits

Author SHA1 Message Date
Mario Limonciello
fa9a43a690 Add support to set autosuspend delay via hwdb 2022-05-09 21:14:12 -05:00
Yu Watanabe
31090c17f4 Merge pull request #23321 from poettering/sockaddr-no-cast
tests: avoid sockaddr casts
2022-05-09 23:44:01 +09:00
Yu Watanabe
d171e72e7a core/slice: make slice_freezer_action() return 0 if freezing state is unchanged
Fixes #23278.
2022-05-09 23:43:32 +09:00
Luca Boccassi
37b7eef35d mkosi: add shadow package to SUSE Tumbleweed
[1958/1958] Generating export-dbus-interfaces with a custom command
/root/mkosi.build: line 70: groupadd: command not found
2022-05-09 14:58:06 +01:00
Lennart Poettering
f9a1fd2a3b test: JSON_BUILD_REAL nowadays expects 'double', not 'long double'
Follow-up for 337712e777, aka "the great
un-long-double-ification of 2021".
2022-05-09 14:32:31 +02:00
Lennart Poettering
3bf175f076 tests: avoid (struct sockaddr*) casts
We prefer using using union sockaddr_union instead of casting sockaddr
to the correct types.

Coding style, nothing else.

Follow-up for 0dd5ec58fa.
2022-05-09 13:56:39 +02:00
Lennart Poettering
b501e42e71 socket-util: don't reference field by macro parameter name
Let's avoid ambigituies here. (Interesting that the current users
compiled at all, in fact)
2022-05-09 13:55:28 +02:00
Lennart Poettering
3a466defd4 update TODO 2022-05-09 12:17:08 +02:00
Yu Watanabe
a6b084234c network: set/unset enumerating flag before/after loop 2022-05-09 18:59:24 +09:00
Daan De Meyer
2aaf6d407e shared: Fix memory leak in bus_append_execute_property()
Fixes #23317
2022-05-09 18:58:55 +09:00
Yu Watanabe
df423851fc Merge pull request #23310 from keszybz/suppress-fuzzer-timeouts-and-errors
Suppress fuzzer timeouts and errors
2022-05-09 15:50:29 +09:00
Yu Watanabe
b5be9dbebf Merge pull request #23311 from keszybz/bootspec-fuzzer
Fuzzer for bootspec.c and associated fixes
2022-05-09 15:46:49 +09:00
Zbigniew Jędrzejewski-Szmek
3947432eb0 shared/calendarspec: reduce scope of variables 2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
68ac5118e7 shared/dissect-image: apply standard indentation 2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
a9d178d28b basic/virt: use STRV_FOREACH instead of iteration with ELEMENTSOF
I think it's a bit simpler, we don't have two indexes.
2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
c9c3b81f12 libsystemd-network: constify casts
It is better to not drop the const-ness from the argument.
2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
2034c8b883 tree-wide: drop de-constifying casts for strv iteration
When the the iterator variable is declared automatically, it "inherits" the
const/non-const status from the argument. We don't need to cast a const
table to non-const. If we had a programming error and tried to modify the
string, the compiler could now catch this.
2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
40893cbfd5 fuzz-journal-remote: allow -ENODATA too
It seems that we try to create a new file, which fails with -ENOSPC, and we
later fail when reading a file with ENODATA.  journal_file_open() will return
-ENODATA if the file is too short or if journal_file_verify_header() fails.
We'll unlink a file we newly created if we fail to initialize it immediately
after creation. I'm not sure if the file we fail to open is the one we newly
created and e.g. failed to create the arena and such, or if it's the file we
were trying to rotate away from. Either way, I think we should be OK with
with a non-fully-initialized journal file.

Failed to create rotated journal: No space left on device
Failed to write entry of 2 bytes: No space left on device
sd_journal_open_files(["/tmp/fuzz-journal-remote.vELRpI.journal"]) failed: No data available
Assertion 'IN_SET(r, -ENOMEM, -EMFILE, -ENFILE)' failed at src/journal-remote/fuzz-journal-remote.c:70, function int LLVMFuzzerTestOneInput(const uint8_t *, size_t)(). Aborting.

oss-fuzz-39238: https://oss-fuzz.com/issue/4609851129462784
2022-05-08 22:47:50 +02:00
Zbigniew Jędrzejewski-Szmek
44468876c3 fuzz-systemctl-parse-argv: refuse commandlines above 1k entries
oss-fuzz reports timeouts which are created by appending to a very long strv.
The code is indeed not very efficient, but it's designed for normal
command-line use, where we don't expect more than a dozen of entries. The fact
that it is slow with ~100k entries is not particularly interesting.

In the future we could rework the code to have better algorithmic complexity.
But let's at least stop oss-fuzz from wasting more time on such examples.

(My first approach was to set max_len in .options, but apparently this doesn't
work for hongfuzz and and AFL.)

oss-fuzz-34527: https://oss-fuzz.com/issue/5722283944574976
2022-05-08 22:47:50 +02:00
Yu Watanabe
734582830b core/unit: fix use-after-free
Fixes #23312.
2022-05-08 22:45:07 +02:00
Zbigniew Jędrzejewski-Szmek
d4f72d104f shared/bootspec: add missing terminator to table 2022-05-08 17:58:00 +02:00
Zbigniew Jędrzejewski-Szmek
a89dd095e1 fuzz-bootspec: also add loader autoentries 2022-05-08 17:58:00 +02:00
Zbigniew Jędrzejewski-Szmek
13dcfbd32d fuzz-bootspec: one more test case that was fixed in strv code 2022-05-08 17:58:00 +02:00
Zbigniew Jędrzejewski-Szmek
b6bd2562eb shared/bootspec: avoid crashing on config without a value 2022-05-08 17:58:00 +02:00
Zbigniew Jędrzejewski-Szmek
1409ce6ed2 Add fuzzer for the bootspec parser 2022-05-08 17:58:00 +02:00
Zbigniew Jędrzejewski-Szmek
a847b539de shared/bootspec: also export boot_config_load_type1()
The reallocation of memory and counter incrementation is moved from
the only caller to the function. This way the callers can remain oblivious
of the BootConfig internals.
2022-05-08 17:57:57 +02:00
Zbigniew Jędrzejewski-Szmek
5ba1550fd8 shared/bootspec: expose more parts of the config parsing 2022-05-08 17:56:12 +02:00
Zbigniew Jędrzejewski-Szmek
432ce53737 Move printing of boot entries from bootctl.c to shared/
I want to use this for fuzzing, but also later to return jsonified
list of entries from logind.
2022-05-08 17:55:03 +02:00
Zbigniew Jędrzejewski-Szmek
ec725c0c49 shared/bootspec: add one more assert
All callers assume that boot_entry_title() always returns something.
It will, as long as it's not called on an uninitialized entry.
2022-05-08 17:53:56 +02:00
Zbigniew Jędrzejewski-Szmek
91da36f195 meson: sort list of fuzzers 2022-05-08 17:53:56 +02:00
Zbigniew Jędrzejewski-Szmek
c04361d725 docs/ARCHITECTURE: describe fuzzer locations and use 2022-05-08 17:53:56 +02:00
Zbigniew Jędrzejewski-Szmek
7f5b2615a7 dissect: drop unnecessary {} 2022-05-08 16:23:13 +02:00
Yu Watanabe
4e5f4733c5 bash-completion: resolvectl: add missing options and verb 2022-05-08 14:14:28 +02:00
lucagoc
97d670a429 hwdb: add rammus accelerometer support 2022-05-08 09:09:35 +09:00
Daan De Meyer
b1ba0ce800 core/device: Use DEVICE_NOT_FOUND instead of 0.
Use the enum name instead of the value zero. This is a noop change
as DEVICE_NOT_FOUND == 0.
2022-05-07 20:05:10 +01:00
Jan Janssen
f7ae43795c boot: Fix null pointer dereference 2022-05-07 21:56:06 +09:00
Yu Watanabe
3c60643848 man: fix typo 2022-05-07 15:17:56 +09:00
Yu Watanabe
87d3b4ef3b Merge pull request #23292 from alexhenrie/dhcpv6
network: clarify relationship between RA flags and DHCPv6 modes
2022-05-07 11:42:45 +09:00
Zbigniew Jędrzejewski-Szmek
680f2fb39d shared/json: disentangle flag mixup
_DEBUG and _RELAX had the same value… I'm not sure what the effect
of this is.
2022-05-07 11:41:57 +09:00
Alex Henrie
6e40d0e458 network: clarify the relationship between DHCP= and WithoutRA=
Just setting DHCP=ipv6 is not enough to get DHCPv6 working without RA.
The WithoutRA option must also be changed from its default of "no".
2022-05-06 14:01:53 -06:00
Alex Henrie
0bcc6557fb network: clarify the relationship between RA flags and DHCPv6 modes
In the documentation, using the term "managed" for both the RA flag and
the DHCPv6 mode is confusing because the mode is referred to as
"solicit" both in the official DHCPv6 documentation (see RFC 8415) and
in the WithoutRA option.

Furthermore, calling the other RA flag "other information" or "other
address configuration" is confusing because its official name is simply
"other configuration" (see RFC 4861 and RFC 5175) and it isn't used to
assign IP addresses.

Rewrite the documentation for DHCPv6Client and WithoutRA to make it
clear that getting the "managed" RA flag triggers the same kind of DHCP
request as WithoutRA=solicit, whereas getting the "other configuration"
RA flag triggers the same kind of DHCP request as
WithoutRA=information-request.
2022-05-06 14:01:53 -06:00
Yu Watanabe
01af366ef9 Merge pull request #23291 from yuwata/udev-rule-fix-regression
udev: fix parent token handling
2022-05-07 04:58:20 +09:00
Yu Watanabe
0139026b3e Merge pull request #23290 from keszybz/three-fixes
Three fixes
2022-05-07 04:57:36 +09:00
Yu Watanabe
af2ff171e0 Merge pull request #23272 from keszybz/logind-man-and-rules
Logind man and rules
2022-05-07 04:23:02 +09:00
Yu Watanabe
d94802e988 test: add testcase for #23288 2022-05-07 02:51:31 +09:00
Yu Watanabe
eba782d59b udev: fix parent token handling
This fixes a bug introduced by 03677889f0.

Fixes #23288.
2022-05-07 02:51:21 +09:00
Zbigniew Jędrzejewski-Szmek
b38a9d2d77 basic/strv: fix splitting of strings with escape characters
Plain strv_split() should not care if the strings contains backslashes
or quote characters. But extract_first_word() interprets backslashes
unless EXTRACT_RETAIN_ESCAPE is given.

I wonder how it's possible that nobody noticed this before. I think this
code was introduced in 0645b83a40.
2022-05-06 18:26:30 +02:00
Zbigniew Jędrzejewski-Szmek
34c2d32cf9 shared/terminal-util: don't use $COLORTERM to force colors
Fixup for a5efbf468c: if $COLORTERM was set, we'd
unconditionally turn on colors, which is unexpected and wrong. It even breaks
our own tests when executed in gnome-terminal.
2022-05-06 18:26:26 +02:00
Yu Watanabe
ad11dd94fd README: mention kernel requirement for ambient capabilities
Closes #23231.
2022-05-06 09:33:49 +01:00
Khem Raj
0dd5ec58fa resolve: Use sockaddr pointer type for bind()
bind() expects sockaddr* but SERVER_ADDRESS is sockaddr_in type struct

Fixes errors with clang e.g.

../git/src/resolve/test-resolved-stream.c:112:32: error: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Werror,-Wincompatible-pointer-types]
        assert_se(bind(bindfd, &SERVER_ADDRESS, sizeof(SERVER_ADDRESS)) >= 0);
                               ^~~~~~~~~~~~~~~
../git/src/resolve/test-resolved-stream.c:251:39: error: incompatible pointer types passing 'struct sockaddr_in *' to parameter of type 'const struct sockaddr *' [-Werror,-Wincompatible-pointer-types]
                r = connect(clientfd, &SERVER_ADDRESS, sizeof(SERVER_ADDRESS));

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-05-06 17:29:59 +09:00