Commit Graph

57868 Commits

Author SHA1 Message Date
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