Commit Graph

68665 Commits

Author SHA1 Message Date
Lennart Poettering
d30693f39b analyze: add "srk" verb to extract current srk from TPM2 chip
This is pretty low-level functionality, hence placed in systemd-analyze.
This is useful for working with systemd-cryptenroll --tpm2-device-key=,
as it acquires the SRK without requiring the full tpm2-tss tool set.
2023-11-09 12:48:27 +01:00
Lennart Poettering
fbe7db47f4 tpm2-setup: also save the SRK to the file system in TPM2_PUBLIC format
We already save it in PEM format, also store it TPM2_PUBLIC format next
to it. This is useful for usage with systemd-cryptenroll's
--tpm2-device-key= switch.
2023-11-09 12:47:24 +01:00
Lennart Poettering
fadc7d8cd7 repart: add missing --tpm2-pcrlock= in --help text
Follow-up for: 404aea7815
2023-11-09 11:36:13 +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
Lennart Poettering
b6be6a6721 man: document explicitly tha ReadWritePaths= cannot undo superblock read-only settings
Fixes: #29266
2023-11-09 09:39:12 +01: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
730ccf9681 test: use Type=notify together with busctl monitor
Let's use the newly gained feature of `busctl` and start is as a
Type=notify unit, which should make sure the unit is started only after
`busctl` is on the bus listening for messages.

This should help with a race spotted in CIs, where we continued too
early after starting `busctl monitor` and miss the emitted signals:

[   10.914831] testsuite-45.sh[694]: + systemd-run --unit busctl-monitor.service --service-type=exec busctl monitor --json=short '--match=type='\''signal'\'',sender=org.freedesktop.timesync1,member='\''PropertiesChanged'\'',path=/org/free>
[   11.064365] systemd[1]: Starting busctl-monitor.service...
[   11.064903] systemd[1]: Started busctl-monitor.service.
[   11.065192] testsuite-45.sh[740]: Running as unit: busctl-monitor.service; invocation ID: ee44a9d713c34b9a97e3e7f6f4fffe77
...
[   11.069255] testsuite-45.sh[694]: + timedatectl ntp-servers ntp99 10.0.0.1
[   11.077140] systemd-timesyncd[728]: Network configuration changed, trying to establish connection.
[   11.077461] testsuite-45.sh[694]: + assert_networkd_ntp ntp99 10.0.0.1
...
[   11.087418] testsuite-45.sh[694]: + assert_timesyncd_signal '2023-11-08 16:28:48.861455' LinkNTPServers 10.0.0.1
...
[   11.095543] testsuite-45.sh[694]: + for _ in {0..9}
[   11.095543] testsuite-45.sh[694]: + journalctl -q '--since=2023-11-08 16:28:48.861455' -p info _SYSTEMD_UNIT=busctl-monitor.service --grep .
[   11.193258] systemd-journald[375]: Received client request to sync journal.
[   11.112424] testsuite-45.sh[694]: + sleep .5
[   11.160318] dbus-daemon[465]: [system] Connection :1.56 (uid=0 pid=741 comm="/usr/bin/busctl monitor --json=short --match=type=") became a monitor.

Resolves: #29923
2023-11-09 00:00:27 +01: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
Frantisek Sumsal
9a42457bae test: drop some unnecessary quotes 2023-11-08 23:38:28 +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
Yu Watanabe
425e8065b7 Merge pull request #29932 from yuwata/default-network-cleanups
network: several cleanups for default .network files
2023-11-09 05:15:13 +09: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
37f16ef072 ci: add -Dutmp=false coverage 2023-11-08 18:41:47 +00:00
Luca Boccassi
de3612dbd7 core: fix build with -Dutmp=false 2023-11-08 18:41:47 +00:00
Michal Sekletar
e5883df89f man: document nameserver= option 2023-11-08 17:45:35 +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
Lennart Poettering
9f97ca70dd update TODO 2023-11-08 18:18:07 +01:00
Yu Watanabe
0fd9bea38e man: fix typo
Follow-up for a9d54de66d.
2023-11-09 00:09:13 +09:00
Yu Watanabe
e5188e4f9b network: make 89-ethernet.network match only physical interfaces
For safety. We already add similar condition to a generated one:
c25aa6c8ac
2023-11-08 23:11:45 +09:00