Commit Graph
46100 Commits
Author SHA1 Message Date
Sam Leonard f72a085641 vmspawn: added vsock functionality
also includes cosmetic fixups from: https://github.com/systemd/systemd/pull/29874
2023-11-09 10:36:25 +00:00
Florian Schmaus 8930285234 core: fix array size in unit_log_resources()
In 0531bded79 ("core: include peak memory in unit_log_resources()") new log
messages where added, however the size of the according arrays to hold the
messages was not adjusted.

Fixes: 0531bded79 ("core: include peak memory in unit_log_resources()")
2023-11-09 09:59:10 +00:00
Yu Watanabe 0bc649d6b0 Merge pull request #29949 from mrc0mmand/even-more-ntp-followups
busctl: send READY=1 when we become a monitor
2023-11-09 15:08:31 +09:00
Yu Watanabe 6900d90877 Merge pull request #29939 from YHNdnzj/fdopen-independent-mode
basic/fileio: drop O_CREAT in flags passed to fd_reopen
2023-11-09 15:07:11 +09:00
Frantisek Sumsal c39a6ab789 busctl: send READY=1 when we become a monitor
This is pretty much the same stuff as `resolvectl monitor` does, and
allows us to run `busctl monitor` in a Type=notify unit which ensures
that `busctl` is really listening for messages once the unit is marked
as started.
2023-11-08 23:57:27 +01:00
Dan Nicholson 9217255427 test-process-util: Handle unprivileged setrlimit success
Currently test_setpriority_closest assumes that setting RLIMIT_NICE to 30 will
fail if the process is unprivileged. If it succeeds, it assumes that the
process is privileged and setresuid and setresgid will succeed.

However, if RLIMIT_NICE is already >= 30, then setrlimit will succeed even if
the process is unprivileged. Guard against that by checking for permission
errors in setresuid and setresgid and skipping the full test if so.

Fixes #22896.
2023-11-08 21:29:16 +00:00
Felix Dörre e375bc5fcc journalctl: verify sealed log epochs are continuous
Currently empty epochs are not sealed. This allows an attacker to truncate
a sealed log and continue it without any problems showing when verifying the
log.

This partially addresses CVE-2023-31438. One way to extend this change to
address CVE-2023-31438 completely, would be to verify that there is exactly
one seal per epoch (and not sealing when the epoch has not ended yet).

the change also adds a journal-file flag: HEADER_COMPATIBLE_SEALED_CONTINUOUS
this flag indicates that a journal file is sealed continuously and decides whether
any missing crypto epochs should trigger a warning or an error.
2023-11-09 05:13:27 +09:00
Luca Boccassi 3e433afac9 Merge pull request #29942 from bluca/executor_no_utmp
core: fix build with -Dutmp=false
2023-11-08 20:01:39 +00:00
Luca Boccassi fe7109fc2e Merge pull request #29927 from yuwata/resolve-mdns-fixlets
resolve: several mdns fixlets
2023-11-08 19:56:31 +00:00
Luca Boccassi 98a10e385d Merge pull request #29931 from dtardon/udev-remove-property
udev-manager: actually remove the property
2023-11-08 19:55:45 +00:00
Mike Yuan 6f9677bc7f basic/fileio: drop O_CREAT before passing flags to fd_reopen
Follow-up for 78c21009bf

Fixes #29938
2023-11-09 03:38:14 +08:00
Mike Yuan 05314c9c87 fd-util: refuse O_CREAT in fd_reopen
O_CREAT doesn't make sense for fd_reopen, since we're
working on an already opened fd. Also, in fd_reopen
we don't handle the mode parameter of open(2), which
means we may get runtime error like #29938.
2023-11-09 03:35:56 +08:00
Luca Boccassi de3612dbd7 core: fix build with -Dutmp=false 2023-11-08 18:41:47 +00:00
Luca Boccassi e34435857e core: call mac_init from sd-executor
Before the split the SELinux database was inherited via CoW. Since
the split we need to reopen it.

Follow-up for bb5232b6a3
2023-11-08 17:44:36 +00:00
David Tardon 25270051cc udev-manager: mark old_key as unused too 2023-11-08 14:52:43 +01:00
Yu Watanabe dd51c4332f resolve/mdns: silently ignore Known-Answers only packets 2023-11-08 22:45:14 +09:00
Yu Watanabe 6f087266e3 resolve/mdns: allow mDNS queries with truncation flag
If the query has many Known-Answers records, then the truncation flag is
set.

Fixes #29168.
2023-11-08 22:45:14 +09:00
Yu Watanabe 614af79cfc resolve: tweak logs about truncation 2023-11-08 22:45:07 +09:00
David Tardon e1593039db udev-manager: actually remove the property
AFAICT there's no reason to keep removed entries in the Hashmap
(although it doesn't break anything either). The only use of this
hashmap is in udev_rule_apply_token_to_event(), which just retrieves the
value using hashmap_get(), hence there's no difference there between an
existing entry with a NULL value and a missing entry.
2023-11-08 14:41:28 +01:00
Yu Watanabe 7645e5a813 resolve/mdns: split out mdns_make_dummy_packet()
Then, this fixes the following issues:
- if dns_packet_append_zone() for other transaction is failed with
  EMSGSIZE, the previously added key was not removed,
- if dns_transaction_prepare() for other transaction returns 0, then
  we restated the loop without dropping previously appended keys, which
  might not be necessary any more.
2023-11-08 21:38:54 +09:00
Yu Watanabe 6cfa4fc4ce resolve/mdns: do not append packets without records
Previously, if we have only max_rr cached entries, then an empty packet
is appended.

Prompted by #29168.
2023-11-08 21:38:22 +09:00
Luca Boccassi bb4791ec85 Merge pull request #29921 from yuwata/sd-dhcp-client-timestamp
dhcp: further cleanups for timestamp
2023-11-08 10:55:11 +00:00
Ronan Pigott 7f0dbde467 resolvectl: do not sort domain output
The order of search domains is important information. We shouldn't
obscure it by sorting the search domains when printing.

Fixes: af781878d5 ("resolvectl: sort domain/nta output")
2023-11-08 10:04:35 +00:00
Lennart Poettering e3c5842732 Merge pull request #28519 from ddstreet/tpm2_external_seal
Update systemd-cryptenroll to enroll TPM using only public key
2023-11-08 10:28:28 +01:00
Yu Watanabe 905d0ea7b0 sd-dhcp-client,-server: set timestamp based on the time when received a packet
It seems that RFC does not say anything about the timestamp of lease
we should use: time that the client sent a request or received a reply.
In DHCPv6 client and NDisc, we use a timestamp that we receive a packet,
rather than we sent something. So, let's consistently use the same
logic for DHCPv4 client.

By using the logic, we will hopefully not forget to set timestamp again,
which is fixed by 089362976c.
2023-11-08 17:58:51 +09:00
Yu Watanabe a57dd1d13f sd-dhcp-client: move packet size check to dhcp_packet_verify_headers()
No functional change.
2023-11-08 17:54:52 +09:00
Yu Watanabe 7f42c66015 sd-dhcp-client: split out client_verify_message_header()
This is not necessary to be called when a packet is received through the
RAW socket, but should not hurt anything.
2023-11-08 17:54:30 +09:00
Yu Watanabe d9c4917b9e vmspawn: fix memleak
Fixes CID#1523912.
2023-11-08 07:54:10 +01:00
Yu Watanabe c62345ffc7 tree-wide: fix typo 2023-11-08 14:57:33 +09:00
Yu Watanabe 69f50bf35e sd-dhcp-client: make client_handle_message() propagate critical error
Then, stop client in the caller side.

This also makes
- ignore all errors except for resource errors like OOM when FORCERENEW
  is received,
- trigger assertion when an message received even if the client is
  stopped.

This should not change any functionality. Just refactoring.
2023-11-08 13:03:40 +09:00
Yu Watanabe b2622db0df Merge pull request #29910 from yuwata/rapid-commit
dhcp: about rapid commit
2023-11-08 12:20:17 +09:00
Luca Boccassi 9871279cde Merge pull request #29913 from keszybz/vmspawn-ci
Build vmspawn in CI and fix one test failure
2023-11-07 23:35:48 +00:00
Luca Boccassi ee32d7a640 Merge pull request #29915 from mrc0mmand/ntp-followups
timesync: fix PropertiesChanges signals for NTP properties
2023-11-07 22:38:23 +00:00
Zbigniew Jędrzejewski-Szmek 0919dbebb0 vmspawn: add missing include
../src/src/vmspawn/vmspawn-util.c:33:13: error: implicit declaration of function ‘access’; did you mean ‘accept’? [-Werror=implicit-function-declaration]
2023-11-07 22:50:37 +01:00
Luca Boccassi 00666ec71f Merge pull request #6763 from kinvolk/iaguis/no-new-privs
core: allow using seccomp without no_new_privs when unprivileged
2023-11-07 21:34:49 +00:00
Luca Boccassi b485c1bf4e Merge pull request #29914 from yuwata/network-generator
network-generator: several cleanups and follow-ups for dns server handling
2023-11-07 20:51:21 +00:00
Zbigniew Jędrzejewski-Szmek ed739145fb xdg-autostart: downgrade warning for missing executables
On a system with a shared home directory, I'm getting a bunch of warnings:

systemd-xdg-autostart-generator[76]: Exec binary '/usr/bin/flatpak' does not exist: No such file or directory
systemd-xdg-autostart-generator[76]: /home/zbyszek/.config/autostart/org.signal.Signal.desktop: not generating unit, error parsing Exec= line: No such file or directory
systemd-xdg-autostart-generator[76]: Exec binary '/usr/bin/flatpak' does not exist: No such file or directory
systemd-xdg-autostart-generator[76]: /home/zbyszek/.config/autostart/im.riot.Riot.desktop: not generating unit, error parsing Exec= line: No such file or directory
systemd-xdg-autostart-generator[76]: Exec binary '/usr/libexec/gnome-tweak-tool-lid-inhibitor' does not exist: No such file or directory
systemd-xdg-autostart-generator[76]: /home/zbyszek/.config/autostart/ignore-lid-switch-tweak.desktop: not generating unit, error parsing Exec= line: No such file or directory
systemd-xdg-autostart-generator[76]: Exec binary '/usr/bin/flatpak' does not exist: No such file or directory
systemd-xdg-autostart-generator[76]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop: not generating unit, error parsing Exec= line: No such file or directory

This isn't really a problem. Let's just print an info message.
2023-11-07 20:47:04 +00:00
Frantisek Sumsal 9521574cd4 timesync: fix PropertiesChanges signals for NTP properties
As in their current form they didn't work at all:

systemd-timesyncd[190115]: Assertion 's' failed at src/libsystemd/sd-event/sd-event.c:3058, function sd_event_source_set_enabled(). Ignoring.
systemd-timesyncd[190115]: Failed to reenable system ntp server change event source!
systemd-timesyncd[190115]: Failed to enable ntp server defer event, ignoring: Invalid argument

This was also pointed out in the post-merge review [0].

Let's address this together with the rest of the comments, and add
some tests to make sure everything works as it should.

Resolves: #28770
Follow-up to: 8f1c446

[0] https://github.com/systemd/systemd/commit/8f1c4469793f2f0281fdfbc20ba4085e20cdd16f#r124147466
2023-11-07 21:36:59 +01:00
Lennart Poettering a338ccaa98 systemctl: grey out legend
The legend is not the primary information, but simply explanatory, hence
grey it out a bit.

This mimics what we do for pcrlock.
2023-11-07 20:07:43 +00:00
Yu Watanabe b86f60bfb3 network-generator: refuse unexpected trailing strings 2023-11-08 04:29:45 +09:00
Yu Watanabe 816c269e55 network-generator: allow to specify both IPv4 and IPv6 DNS servers
Follow-up for 923599523c.
2023-11-08 04:29:45 +09:00
Yu Watanabe 8ae81a1e00 network-generator: add missing assertions 2023-11-08 04:29:45 +09:00
Yu Watanabe 0b0865f509 network-generator: drop unused family argument 2023-11-08 04:29:45 +09:00
Yu Watanabe 13a462b9d5 network-generator: relax requirement for peer address, route destination, and gateway
No functional changes, as the caller already sets them.
2023-11-08 04:29:45 +09:00
Zbigniew Jędrzejewski-Szmek 6527d175cd vmspawn: shorted --help output to fit in 80 columns
I think that "SB" is good enough here, the option name shows the unabbreviated
name.
2023-11-07 18:59:19 +01:00
Yu Watanabe 1fa0a4eff7 network: add [DHCPServer] RapidCommit= setting 2023-11-08 02:42:03 +09:00
Yu Watanabe 538ff0a60a sd-dhcp-server: support rapid commit (RFC4039)
https://datatracker.ietf.org/doc/html/rfc4039
2023-11-08 02:39:59 +09:00
Lennart Poettering 38bf0a2361 Merge pull request #29876 from poettering/kernel-install-all
add "kernel-install list" and "kernel-install add-all"
2023-11-07 18:29:47 +01:00
Dan Streetman c3a2a681be cryptenroll: add support for calculated TPM2 enrollment
Instead of enrolling the local TPM to a luks volume, use the public key from a
TPM to enroll it into the luks volume. This is useful when enrolling a TPM that
is not currently accessible, for example if the TPM is located on a different
system.
2023-11-07 12:20:54 -05:00
Yu Watanabe 089362976c sd-dhcp-client: unconditionally set sd_dhcp_client.request_sent when a packet is sent
If a server replies an ACK for the initial DISCOVER, previously
request_sent was not set, so networkd handle the lease timed out.

Follow-up for 808b65a087.
2023-11-08 02:18:15 +09:00