Commit graph

57798 commits

Author SHA1 Message Date
Yu Watanabe ab21290049 mkosi: drop libiptc from build for Fedora
It is mostly deprecated on Fedora.
2022-05-13 04:21:27 +09:00
Yu Watanabe 2481f0369c mkosi: test-acl-util requires getfacl 2022-05-13 03:09:42 +09:00
Yu Watanabe e2c99d3b5c CI: use Fedora 36 2022-05-13 02:46:13 +09:00
Zbigniew Jędrzejewski-Szmek 7353de27b7 man,mkosi: fedora 36 has been released 2022-05-13 02:34:07 +09:00
Yu Watanabe 0ffffade03
Merge pull request #23361 from keszybz/resolved-helpers
Add some ref-unref helpers for resolved
2022-05-13 02:33:29 +09:00
Yu Watanabe 57ee137ff2
Merge pull request #23358 from keszybz/fuzzer-input-sizes
fuzzers: add input size limits, always configure limits in two ways
2022-05-13 01:04:20 +09:00
Zbigniew Jędrzejewski-Szmek 899e3cdada resolved: add DNS_PACKET_REPLACE 2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek 5731844157 resolved: add DNS_RESOURCE_KEY_REPLACE 2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek 7daeec3e6c resolved: add DNS_RR_REPLACE 2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek 1117a96087 resolved: add DNS_ANSWER_REPLACE
C.f. ce913e0ec4.
2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek 14b71de4e1 resolved: use saturate_add() 2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek 8b0c43475a Add saturate_add() that generalizes size_add() 2022-05-12 17:15:51 +02:00
Zbigniew Jędrzejewski-Szmek cd0cade1ad
Merge pull request #23289 from yuwata/resolve-answer-add-rrsig
resolve: place RRSIG after the corresponding entries
2022-05-12 16:15:12 +02:00
Zbigniew Jędrzejewski-Szmek c4f883b78e fuzzers: ignore size limits when compiled standalone
This way we can still call fuzzers on old samples, but oss-fuzz will not waste
its and our time finding overly large inputs.
2022-05-12 14:57:07 +02:00
Stefan Seering 026d48ba93 fix typo 2022-05-12 21:13:03 +09:00
Yu Watanabe 7593691aad fuzzers: add input size limits, always configure limits in two ways
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>
2022-05-12 13:31:11 +02:00
Zbigniew Jędrzejewski-Szmek 96974ea4a8 fuzz-dhcp-server: remove limit on input size
It was added originally back in 2bd37c5be2,
but there doesn't seem to by any particular reason for it.
2022-05-12 13:30:44 +02:00
Yu Watanabe b692ad36b9 sd-device-enumerator: fix inverted return value of match_initialized()
Fixes a bug introduced by d8b50e5df7.

Fixes https://github.com/systemd/systemd/pull/22662#issuecomment-1124163773.
Fixes RHBZ#2083374 (https://bugzilla.redhat.com/show_bug.cgi?id=2083374).
2022-05-12 09:31:23 +02:00
Evgeny Vereshchagin d0880faa5d tests: ignore dbus-broker-launcher
There are memory leaks there https://github.com/bus1/dbus-broker/issues/289
and it crashes from time to time
https://github.com/matusmarhefka/dfuzzer/issues/20#issuecomment-1114097840
so let's just skip it by analogy with dbus-daemon to avoid
reports that have nothing to do with systemd itself.

It's kind of a part of https://github.com/systemd/systemd/pull/22547
2022-05-12 14:44:01 +09:00
Yu Watanabe 34f6ae24c5
Merge pull request #23351 from keszybz/logind-message
logind: fix crash in logind on bad message string
2022-05-12 05:25:21 +09:00
Luca Boccassi 0cfb00d9da man: improve VtableExample
The methods published by the example have a reply in the signature, but
the code was not sending any, so the client gets stuck waiting for a
response that doesn't arrive. Echo back the input string.

Update the object path to follow what would be the canonical format.

Request a service name on the bus, so that the code can be dropped in a
service and it can be dbus-activatable. It also makes it easier to see
on busctl list.
2022-05-11 19:12:24 +01:00
Zbigniew Jędrzejewski-Szmek 011a03a3fa meson: turn on log-message-verification by default in developer builds
I'm not _quite_ convinced that this a good idea… I'm at least keeping
it separate to make it easy to revert ;)
2022-05-11 18:18:59 +02:00
Luca Boccassi 646cba5c42 test: ignore LXC filesystem when checking for writable locations
test-execute checks that only /var/lib/private/waldo is writable, but there are
some filesystems that are always writable and excluded. Add /sys/devices/system/cpu
which is created by lxcfs.

Fixes https://github.com/systemd/systemd/issues/23263
2022-05-11 17:11:41 +02:00
Luca Boccassi 67b1e9d03d
Merge pull request #23349 from eliasp/doc-typo
Fix typo in docs/BUILDING_IMAGES.md, format `PID 1` consistently in docs/
2022-05-11 15:59:40 +01:00
Zbigniew Jędrzejewski-Szmek 1ec7c15613 Do LOG_MESSAGE_VERIFICATION in coverity runs
This should be enough to get reports if we screw up anywhere, coverity does
analysis of printf format strings.
2022-05-11 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek b9ce5cf9ca Optionally call printf on LOG_MESSAGE() arguments
With an intentional mistake:

../src/login/logind-dbus.c: In function ‘bus_manager_log_shutdown’:
../src/login/logind-dbus.c:1542:39: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
 1542 |                           LOG_MESSAGE("%s %s", message),
      |                                       ^~~~~~~
2022-05-11 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek f66020ab7f core: use LOG_UNIT_MESSAGE() where appropriate 2022-05-11 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek 92663a5e5b tree-wide: use LOG_MESSAGE() where possible
Also break some long lines for more uniform formatting. No functional change.

I went over all log_struct, log_struct_errno, log_unit_struct,
log_unit_struct_errno calls, and they seem fine.
2022-05-11 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek 153d1579ef logind: rename "log_message" to "log_verb"
This field is used to log SHUTDOWN=. Calling it "something-message" is
confusing.
2022-05-11 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek 0cb09bcb82 logind: fix crash in logind on user-specified message string
This is trivially exploitable (in the sense of causing a crash from SEGV) e.g.
by 'shutdown now "Message %s %s %n"'. The message is settable through polkit,
but is limited to auth_admin:

<action id="org.freedesktop.login1.set-wall-message">
         <description gettext-domain="systemd">Set a wall message</description>
         <message gettext-domain="systemd">Authentication is required to set a wall message</message>
         <defaults>
                <allow_any>auth_admin_keep</allow_any>
                <allow_inactive>auth_admin_keep</allow_inactive>
                <allow_active>auth_admin_keep</allow_active>
        </defaults>
</action>

Bug introduced in 9ef15026c0
('logind/systemctl: introduce SetWallMessage and --message', 2015-09-15).
2022-05-11 16:43:31 +02:00
Luca Boccassi 1f066ce255 Update TODO 2022-05-11 14:51:37 +01:00
Elias Probst 8f1a581e0d
Use consistent formatting for PID 1 across docs/ 2022-05-11 15:31:07 +02:00
Elias Probst 6f3961381a
Typo (swich-rootswitch-root) 2022-05-11 15:30:21 +02:00
Zbigniew Jędrzejewski-Szmek 71e2fa54fd
Merge pull request #23331 from kmoriwak/tmpfiles-quickref
man: add missing cleanup-age to tmpfiles.d quickref
2022-05-11 09:08:39 +02:00
Kazuo Moriwaka 4da5e566e7
man: mention to Age parameter in C Type 2022-05-11 15:08:34 +09:00
Yu Watanabe 6bb8928205 meson: sort files 2022-05-11 02:13:15 +09:00
Yu Watanabe 97cda6e10f
Merge pull request #23335 from keszybz/fuzz-json-more-coverage
More coverage in fuzz-json
2022-05-11 02:12:57 +09:00
Zbigniew Jędrzejewski-Szmek 82544241ba fuzz-bootspec: limit input size
https://oss-fuzz.com/testcase-detail/5680508182331392 has the
first timeout with 811kb of input. As in the other cases, the code
is known to be slow with lots of repeated entries and we're fine with
that.
2022-05-11 02:12:35 +09:00
Yu Watanabe 01c99b29e9
Merge pull request #23336 from keszybz/fuzz-calendarspec-more-coverage
More coverage in fuzz-calendarspec
2022-05-11 02:12:11 +09:00
Zbigniew Jędrzejewski-Szmek 99b1145aae shared/json: fix memleak in sort 2022-05-10 17:08:37 +02:00
Zbigniew Jędrzejewski-Szmek 3b6ce05537 shared/json: fix another memleak in normalization 2022-05-10 17:08:37 +02:00
Zbigniew Jędrzejewski-Szmek dbd27c6d28 fuzz-json: also try self-merge operations
This might even work ;)
2022-05-10 17:08:37 +02:00
Zbigniew Jędrzejewski-Szmek 96d651a22b basic/alloc-util: remove unnecessary parens
Those symbols are not macros anymore, so we can drop parens.
2022-05-10 17:08:37 +02:00
Zbigniew Jędrzejewski-Szmek ce913e0ec4 shared/json: add helper to ref first, unref second
This normally wouldn't happen, but if some of those places were called
with lhs and rhs being the same object, we could unref the last ref first,
and then try to take the ref again. It's easier to be safe, and with the
helper we save some lines too.
2022-05-10 17:08:34 +02:00
Zbigniew Jędrzejewski-Szmek 8e1e59b9ad shared/calendarspec: fix formatting of entries which collapse to a star
We canonicalize repeats that cover the whole range: "0:0:0/1" → "0:0:*".  But
we'd also do "0:0:0/1,0" → "0:0:*,0", which we then refuse to parse.  Thus,
first go throug the whole chain, and print a '*' and nothing else if any of the
components covers the whole range.
2022-05-10 14:35:57 +02:00
Zbigniew Jędrzejewski-Szmek 07b420a3b9
Merge pull request #23329 from superm1/mlimonci/lg850-gl
Set auto-suspend delay on LG850-GL
2022-05-10 13:52:36 +02:00
Yu Watanabe 756491af39 core/timer: fix potential use-after-free 2022-05-10 13:50:50 +02:00
Yu Watanabe d3ab7b8078 core/timer: fix memleak
Fixes #23326.
2022-05-10 13:50:50 +02:00
Zbigniew Jędrzejewski-Szmek 3aff2ae9d5 shared/calendarspec: fix printing of second ranges which start with 0
0..3 is not the same as 0..infinity, we need to check both ends of the range.
This logic was added in 3215e35c40, and back then
the field was called .value. .stop was added later and apparently wasn't taken
into account here.
2022-05-10 13:06:32 +02:00
Zbigniew Jędrzejewski-Szmek 4f23345592 test-calendarspec: tighten tests and add more logging 2022-05-10 13:06:32 +02:00