Commit graph

61298 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 400102ec91 basic/strv: check printf arguments to strv_extendf()
The second argument to _printf_() specifies where the arguments start. We need to
use 0 in two cases: when the args in a va_list and can't be checked, and with journald
logging functions which accept multiple format strings with multiple argument sets,
which the _printf_ checker does not understand. But strv_extendf() can be checked.
2022-11-21 20:08:50 +01:00
Zbigniew Jędrzejewski-Szmek 6457ce15be manager: fix format strings for trigger metadata
Fixup for c8bc7519c8.
2022-11-21 20:08:50 +01:00
Yu Watanabe 69b31b29a0
Merge pull request #25395 from poettering/tpm2-dlsym-assert
dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match …
2022-11-22 03:36:03 +09:00
Lennart Poettering 0d9e6d76be mkosi: pull in libbpf1 instead of legacy libbpf0 on debian 2022-11-21 16:13:29 +01:00
Lennart Poettering 7736a71fd2 dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from the official headers
Make sure that the sym_xyz function pointers have the types that the
functions we'll assign them have.

And of course, this found a number of incompatibilities right-away, in
particular in the bpf hookup.

(Doing this will trigger deprecation warnings from libbpf. I simply
turned them off locally now, since we are well aware of what we are
doing in that regard.)

There's one return type fix (bool → int), that actually matters I think,
as it might have created an incompatibility on some archs.
2022-11-21 16:13:17 +01:00
Lennart Poettering 28795f2c13 update TODO 2022-11-21 15:14:22 +01:00
Jason A. Donenfeld a4eea6038c bootctl: install system token on virtualized systems
Removing the virtualization check might not be the worst thing in the
world, and would potentially get many, many more systems properly seeded
rather than not seeded. There are a few reasons to consider this:

- In most QEMU setups and most guides on how to setup QEMU, a separate
  pflash file is used for nvram variables, and this generally isn't
  copied around.

- We're now hashing in a timestamp, which should provide some level of
  differentiation, given that EFI_TIME has a nanoseconds field.

- The kernel itself will additionally hash in: a high resolution time
  stamp, a cycle counter, RDRAND output, the VMGENID uniquely
  identifying the virtual machine, any other seeds from the hypervisor
  (like from FDT or setup_data).

- During early boot, the RNG is reseeded quite frequently to account for
  the importance of early differentiation.

So maybe the mitigating factors make the actual feared problem
significantly less likely and therefore the pros of having file-based
seeding might outweigh the cons of weird misconfigured setups having a
hypothetical problem on first boot.
2022-11-21 15:13:26 +01:00
Daan De Meyer 261b14be76
Merge pull request #25461 from DaanDeMeyer/repart-followups
repart followups
2022-11-21 14:02:25 +01:00
Zbigniew Jędrzejewski-Szmek 2bd051a06d docs/BOOT_LOADER_INTERFACE: reword sentence to apply to both entry types 2022-11-21 12:26:35 +01:00
Zbigniew Jędrzejewski-Szmek db81144428 tree-wide: BLS and DPS are now on uapi-group website 2022-11-21 12:26:35 +01:00
Daan De Meyer 6b1ea55e0b repart: Rework PartitionTarget initialization 2022-11-21 11:47:13 +01:00
Daan De Meyer 488bb758c0 repart: Use fd based operations in partition_populate_directory() 2022-11-21 11:47:13 +01:00
BerndAdameit 082ac7bb12 man/sd_bus_default: Refer to man-pages project (man7.org) for ssh(1) 2022-11-21 11:35:33 +01:00
Lennart Poettering b22afd2844
Merge pull request #25409 from medhefgo/boot-fixes
boot: Several fixes
2022-11-21 11:34:50 +01:00
Daan De Meyer 48b1e18aae repart: Remove redundant parentheses in partition_populate_directory() 2022-11-21 10:53:23 +01:00
Daan De Meyer a9abef7f67 mkfs-util: Use FORK_CLOSE_ALL_FDS 2022-11-21 10:51:15 +01:00
Daan De Meyer 92b11378ff mkfs-util: Prefer fd based stat() where possible 2022-11-21 10:49:37 +01:00
Daan De Meyer 29ec4bce0e mkfs-util: Use GID_FMT 2022-11-21 10:46:59 +01:00
Daan De Meyer 922576e452 repart: Use ASSERT_PTR() in partition_encrypt() 2022-11-21 10:45:26 +01:00
Daan De Meyer 983154f518 repart: Use ftruncate() instead of posix_allocate() 2022-11-21 10:44:38 +01:00
Daan De Meyer 766f52f25c repart: Fix parse_filter_partitions() log messages 2022-11-21 10:36:37 +01:00
Daan De Meyer 53538e33e9 repart: Fix FilterPartitionsType enum name 2022-11-21 10:35:18 +01:00
Daan De Meyer 5f59807d2d repart: Rework unused partition number algorithm 2022-11-21 10:34:28 +01:00
Daan De Meyer c1979cd881 repart: Use IN_SET() in one more place 2022-11-21 10:28:36 +01:00
Richard E. van der Luit 214ba5cadf po: Translated using Weblate (Dutch)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Richard E. van der Luit <fedoraproject@veneax.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/nl/
Translation: systemd/main
2022-11-21 00:43:55 +09:00
Jan Janssen 967a868563 boot: Replace firmware security hooks directly
For some firmware, replacing their own security arch instance with our
override using ReinstallProtocolInterface() is not enough as they will
not use it. This commit goes back to how this was done before by
directly modifying the security protocols.

Fixes: #25336
2022-11-19 16:39:04 +01:00
Jan Janssen 5489c13bae boot: Rework security arch override
This simplifies the caller interface for security arch overrides by only
having to pass a validator and an optional context.
2022-11-19 16:37:27 +01:00
Jan Janssen 679007044f boot: Manually convert filepaths if needed
The conversion of a filepath device path to text is needed for the stub
loader to find credential files.
2022-11-19 16:36:02 +01:00
Jan Janssen af7ef648cd boot: Do not require a loaded image path
If the device path to text protocol is not available (looking angrily at
Apple) we would fail to boot because we cannot get the loaded image
path. As this is only used for cosmetic purposes, we can just silently
continue.

Fixes: #25363
2022-11-19 16:36:02 +01:00
Jan Janssen b7b327f856 boot: Fix memory leak 2022-11-19 16:36:02 +01:00
lichao eb263aabb0 remove obsolete translate in zh_CN.po 2022-11-19 23:51:39 +09:00
Yu Watanabe da2e6df00a
Merge pull request #25438 from poettering/localhost-ifindex-tweak
resolved: fix ifindex for contacting per-interface DNS server if it is 127.0.0.1
2022-11-19 15:36:12 +09:00
Yu Watanabe 26627c088b
Merge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filter
network: tc-cake: support controlling RTT and ACK filter
2022-11-19 15:35:49 +09:00
Mike Yuan 2d8cc7a7bb dbus-manager: add comments about booleans in function calls
Update to match the new coding style
See also: https://github.com/systemd/systemd/pull/25437#discussion_r1026934242
2022-11-19 14:34:08 +09:00
Yu Watanabe 77d5f36d93 test-network: add tests for RTT and ACK filter for CAKE 2022-11-19 07:08:26 +09:00
Yu Watanabe 8c92063633 network: tc-cake: add support to specify ACK filter 2022-11-19 07:08:22 +09:00
Yu Watanabe 8077dc9657
Merge pull request #25389 from fbuihuu/update-test-for-opensuse
Update test/ for openSUSE
2022-11-19 05:58:51 +09:00
Lennart Poettering af1bed8e83 bootctl: rework how we handle referenced but absent EFI boot entries
Follow-up for #25368.

Let's consider ENOENT an expected error, and just debug log about it
(though, let's suffix it with `, ignoring.`). All other errors will log
loudly, as they are unexpected errors.
2022-11-19 05:27:50 +09:00
Lennart Poettering 6e32414a66 resolved: when configuring 127.0.0.1 as per-interface DNS server, contact it via "lo" always
ussually if you specify a DNS server on some interface then we'll use
that interface to talk to it. Let's override this for localhost
addresses, as they only really make sense on "lo".

Fixes: #25397
2022-11-18 16:54:46 +01:00
Lennart Poettering 5faaed5b62 resolved: use right conditionalization when setting unicast ifindex on UDP sockets 2022-11-18 16:53:31 +01:00
Sam James b9e7f22c2d nspawn: allow sched_rr_get_interval_time64 through seccomp filter
We only allow a selected subset of syscalls from nspawn containers
and don't list any time64 variants (needed for 32-bit arches when
built using TIME_BITS=64, which is relatively new).

We allow sched_rr_get_interval which cpython's test suite makes
use of, but we don't allow sched_rr_get_interval_time64.

The test failures when run in an arm32 nspawn container on an arm64 host
were as follows:
```
======================================================================
ERROR: test_sched_rr_get_interval (test.test_posix.PosixTester.test_sched_rr_get_interval)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.11.0_p1/work/Python-3.11.0/Lib/test/test_posix.py", line 1180, in test_sched_rr_get_interval
    interval = posix.sched_rr_get_interval(0)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted
```

Then strace showed:
```
sched_rr_get_interval_time64(0, 0xffbbd4a0) = -1 EPERM (Operation not permitted)
```

This appears to be the only time64 syscall that isn't already included one of
the sets listed in nspawn-seccomp.c that has a non-time64 variant. Checked
over each of the time64 syscalls known to systemd and verified that none
of the others had a non-time64-variant whitelisted in nspawn other than
sched_rr_get_interval.

Bug: https://bugs.gentoo.org/880131
2022-11-18 16:32:17 +01:00
reuben olinsky f8a7112c47 sysupdate: Support volatile-root for finding the root partition
The existing logic can't find the root device in scenarios where
the root has been replaced with an overlay. We support looking
at "/run/systemd/volatile-root" to find the original root, similar
to what systemd-repart and gpt-auto-generator do.
2022-11-18 16:31:22 +01:00
Lennart Poettering d995ccd7b5 update TODO 2022-11-18 14:58:30 +01:00
Lennart Poettering eb2a610210
Merge pull request #25410 from DaanDeMeyer/mkfs-xfs-fixes
Followups for #25400
2022-11-18 14:45:48 +01:00
Li kunyu fc0cc6db1e boot/measure: fix oom check 2022-11-18 21:02:03 +09:00
Franck Bui eb1f60230a test: fix the default timeout values described in README.testsuite
Unlike it was described, the default is 30 min.
2022-11-18 11:09:44 +01:00
Franck Bui cc77a56532 meson: install test-kernel-install only when -Dkernel-install=true
This patch fixes the following build failure:

  meson.build:3853:8: ERROR: Unknown variable "test_kernel_install_sh".

Fixes #25432.
2022-11-18 11:09:35 +01:00
Franck Bui 4e8172c88a tests: update install_suse_systemd()
- Use inst_recursive() and image_install() helpers where appropriate

- Update comments to explain why we need to install the test data manually in
  $initdir

- Install manual/ in $initdir as TEST-35-LOGIN relies on
  manual/test-session-properties
2022-11-18 11:03:22 +01:00
Li kunyu f54f6d88b1
fuzz: fuzz-compress: fix copy-and-paste error: buf -> buf2 (#25431) 2022-11-18 15:03:41 +09:00
Luca Boccassi daefca4611
Merge pull request #25414 from zx2c4-forks/krngseed
EFI random seed post #25319 review fixups
2022-11-17 19:49:40 +01:00