]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
17 months agoMerge pull request #25470 from keszybz/strv-extendf-format
Yu Watanabe [Tue, 22 Nov 2022 03:27:37 +0000 (12:27 +0900)] 
Merge pull request #25470 from keszybz/strv-extendf-format

Improve check for strv_extendf() format string

17 months agosystemctl: edit: write override files as text files
наб [Tue, 8 Nov 2022 20:30:01 +0000 (21:30 +0100)] 
systemctl: edit: write override files as text files

Instead of stripping the newline off the final would-be line;
continue to reduce an empty-line-only file to an empty file, though

Closes #25303

17 months agobootctl: use grey-and-slash prefix for source in list too
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 11:55:35 +0000 (12:55 +0100)] 
bootctl: use grey-and-slash prefix for source in list too

Follow-up for 7851732262ec94f50598c4a289589a6ddb97ebfd. The source
field also shows a path relative to $BOOT, so it should be displayed
in the same fashion.

17 months agoudev: make sure auto-root logic also works in UKIs booted from XBOOTLDR
Lennart Poettering [Mon, 21 Nov 2022 14:32:22 +0000 (15:32 +0100)] 
udev: make sure auto-root logic also works in UKIs booted from XBOOTLDR

If no root= switch is specified on the kernel command line we'll use the
root disk on which the partition the LoaderDevicePartUUID efi var is
located – as long as that partition is an ESP. Let's slightly liberalize
that and also allow it if that partition is an XBOOTLDR partition. This
ensures that UKIs spawned directly from XBOOTLDR work the same as those
from the ESP.

(Note that this makes no difference if sd-boot is in the mix, as in that
case LoaderDevicePartUUID is always set to the ESP, as that's where
sd-boot is located, and sd-boot will set the var first, sd-stub will
only set it later if it#s not set yet.)

17 months agotree-wide: make constant ratelimit compound actually const
Lennart Poettering [Fri, 18 Nov 2022 17:29:16 +0000 (18:29 +0100)] 
tree-wide: make constant ratelimit compound actually const

The compiler should recognize that these are constant expressions, but
let's better make this explicit, so that the linker can safely share the
initializations all over the place.

17 months agoboot: remove random-seed-mode
Jason A. Donenfeld [Mon, 21 Nov 2022 15:40:24 +0000 (16:40 +0100)] 
boot: remove random-seed-mode

Now that the random seed is used on virtualized systems, there's no
point in having a random-seed-mode toggle switch. Let's just always
require it now, with the existing logic already being there to allow not
having it if EFI itself has an RNG. In other words, the logic for this
can now be automatic.

17 months agoMerge pull request #25379 from keszybz/update-doc-links
Luca Boccassi [Tue, 22 Nov 2022 00:07:13 +0000 (01:07 +0100)] 
Merge pull request #25379 from keszybz/update-doc-links

Update doc links

17 months agobasic/strv: check printf arguments to strv_extendf() 25470/head
Zbigniew Jędrzejewski-Szmek [Mon, 21 Nov 2022 19:06:55 +0000 (20:06 +0100)] 
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.

17 months agomanager: fix format strings for trigger metadata
Zbigniew Jędrzejewski-Szmek [Mon, 21 Nov 2022 19:03:08 +0000 (20:03 +0100)] 
manager: fix format strings for trigger metadata

Fixup for c8bc7519c888a99134f88f8c82353246d3c0cc5d.

17 months agoMerge pull request #25395 from poettering/tpm2-dlsym-assert
Yu Watanabe [Mon, 21 Nov 2022 18:36:03 +0000 (03:36 +0900)] 
Merge pull request #25395 from poettering/tpm2-dlsym-assert

dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match …

17 months agomkosi: pull in libbpf1 instead of legacy libbpf0 on debian 25395/head
Lennart Poettering [Fri, 18 Nov 2022 14:13:55 +0000 (15:13 +0100)] 
mkosi: pull in libbpf1 instead of legacy libbpf0 on debian

17 months agodlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from...
Lennart Poettering [Wed, 16 Nov 2022 20:37:20 +0000 (21:37 +0100)] 
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.

17 months agoupdate TODO
Lennart Poettering [Mon, 21 Nov 2022 14:14:22 +0000 (15:14 +0100)] 
update TODO

17 months agobootctl: install system token on virtualized systems
Jason A. Donenfeld [Thu, 17 Nov 2022 15:11:44 +0000 (16:11 +0100)] 
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.

17 months agoMerge pull request #25461 from DaanDeMeyer/repart-followups
Daan De Meyer [Mon, 21 Nov 2022 13:02:25 +0000 (14:02 +0100)] 
Merge pull request #25461 from DaanDeMeyer/repart-followups

repart followups

17 months agodocs/BOOT_LOADER_INTERFACE: reword sentence to apply to both entry types 25379/head
Zbigniew Jędrzejewski-Szmek [Mon, 14 Nov 2022 08:47:01 +0000 (09:47 +0100)] 
docs/BOOT_LOADER_INTERFACE: reword sentence to apply to both entry types

17 months agotree-wide: BLS and DPS are now on uapi-group website
Zbigniew Jędrzejewski-Szmek [Mon, 14 Nov 2022 08:44:39 +0000 (09:44 +0100)] 
tree-wide: BLS and DPS are now on uapi-group website

17 months agorepart: Rework PartitionTarget initialization 25461/head
Daan De Meyer [Mon, 21 Nov 2022 10:23:51 +0000 (11:23 +0100)] 
repart: Rework PartitionTarget initialization

17 months agorepart: Use fd based operations in partition_populate_directory()
Daan De Meyer [Mon, 21 Nov 2022 10:10:34 +0000 (11:10 +0100)] 
repart: Use fd based operations in partition_populate_directory()

17 months agoman/sd_bus_default: Refer to man-pages project (man7.org) for ssh(1)
BerndAdameit [Sun, 20 Nov 2022 09:36:39 +0000 (10:36 +0100)] 
man/sd_bus_default: Refer to man-pages project (man7.org) for ssh(1)

17 months agoMerge pull request #25409 from medhefgo/boot-fixes
Lennart Poettering [Mon, 21 Nov 2022 10:34:50 +0000 (11:34 +0100)] 
Merge pull request #25409 from medhefgo/boot-fixes

boot: Several fixes

17 months agorepart: Remove redundant parentheses in partition_populate_directory()
Daan De Meyer [Mon, 21 Nov 2022 09:53:23 +0000 (10:53 +0100)] 
repart: Remove redundant parentheses in partition_populate_directory()

17 months agomkfs-util: Use FORK_CLOSE_ALL_FDS
Daan De Meyer [Mon, 21 Nov 2022 09:51:15 +0000 (10:51 +0100)] 
mkfs-util: Use FORK_CLOSE_ALL_FDS

17 months agomkfs-util: Prefer fd based stat() where possible
Daan De Meyer [Mon, 21 Nov 2022 09:49:37 +0000 (10:49 +0100)] 
mkfs-util: Prefer fd based stat() where possible

17 months agomkfs-util: Use GID_FMT
Daan De Meyer [Mon, 21 Nov 2022 09:46:12 +0000 (10:46 +0100)] 
mkfs-util: Use GID_FMT

17 months agorepart: Use ASSERT_PTR() in partition_encrypt()
Daan De Meyer [Mon, 21 Nov 2022 09:45:26 +0000 (10:45 +0100)] 
repart: Use ASSERT_PTR() in partition_encrypt()

17 months agorepart: Use ftruncate() instead of posix_allocate()
Daan De Meyer [Mon, 21 Nov 2022 09:44:38 +0000 (10:44 +0100)] 
repart: Use ftruncate() instead of posix_allocate()

17 months agorepart: Fix parse_filter_partitions() log messages
Daan De Meyer [Mon, 21 Nov 2022 09:36:37 +0000 (10:36 +0100)] 
repart: Fix parse_filter_partitions() log messages

17 months agorepart: Fix FilterPartitionsType enum name
Daan De Meyer [Mon, 21 Nov 2022 09:35:18 +0000 (10:35 +0100)] 
repart: Fix FilterPartitionsType enum name

17 months agorepart: Rework unused partition number algorithm
Daan De Meyer [Mon, 21 Nov 2022 09:34:28 +0000 (10:34 +0100)] 
repart: Rework unused partition number algorithm

17 months agorepart: Use IN_SET() in one more place
Daan De Meyer [Mon, 21 Nov 2022 09:28:36 +0000 (10:28 +0100)] 
repart: Use IN_SET() in one more place

17 months agopo: Translated using Weblate (Dutch)
Richard E. van der Luit [Sun, 20 Nov 2022 15:19:54 +0000 (16:19 +0100)] 
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

18 months agoboot: Replace firmware security hooks directly 25409/head
Jan Janssen [Tue, 15 Nov 2022 17:53:02 +0000 (18:53 +0100)] 
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
18 months agoboot: Rework security arch override
Jan Janssen [Tue, 15 Nov 2022 17:22:38 +0000 (18:22 +0100)] 
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.

18 months agoboot: Manually convert filepaths if needed
Jan Janssen [Mon, 14 Nov 2022 14:24:32 +0000 (15:24 +0100)] 
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.

18 months agoboot: Do not require a loaded image path
Jan Janssen [Mon, 14 Nov 2022 13:37:13 +0000 (14:37 +0100)] 
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
18 months agoboot: Fix memory leak
Jan Janssen [Mon, 14 Nov 2022 13:18:26 +0000 (14:18 +0100)] 
boot: Fix memory leak

18 months agoremove obsolete translate in zh_CN.po
lichao [Sat, 19 Nov 2022 12:45:30 +0000 (20:45 +0800)] 
remove obsolete translate in zh_CN.po

18 months agoMerge pull request #25438 from poettering/localhost-ifindex-tweak
Yu Watanabe [Sat, 19 Nov 2022 06:36:12 +0000 (15:36 +0900)] 
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

18 months agoMerge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filter
Yu Watanabe [Sat, 19 Nov 2022 06:35:49 +0000 (15:35 +0900)] 
Merge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filter

network: tc-cake: support controlling RTT and ACK filter

18 months agodbus-manager: add comments about booleans in function calls
Mike Yuan [Fri, 18 Nov 2022 23:49:27 +0000 (07:49 +0800)] 
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

18 months agotest-network: add tests for RTT and ACK filter for CAKE 25423/head
Yu Watanabe [Thu, 17 Nov 2022 11:44:56 +0000 (20:44 +0900)] 
test-network: add tests for RTT and ACK filter for CAKE

18 months agonetwork: tc-cake: add support to specify ACK filter
Yu Watanabe [Thu, 17 Nov 2022 09:27:57 +0000 (18:27 +0900)] 
network: tc-cake: add support to specify ACK filter

18 months agoMerge pull request #25389 from fbuihuu/update-test-for-opensuse
Yu Watanabe [Fri, 18 Nov 2022 20:58:51 +0000 (05:58 +0900)] 
Merge pull request #25389 from fbuihuu/update-test-for-opensuse

Update test/ for openSUSE

18 months agobootctl: rework how we handle referenced but absent EFI boot entries
Lennart Poettering [Fri, 18 Nov 2022 17:05:53 +0000 (18:05 +0100)] 
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.

18 months agoresolved: when configuring 127.0.0.1 as per-interface DNS server, contact it via... 25438/head
Lennart Poettering [Fri, 18 Nov 2022 15:52:06 +0000 (16:52 +0100)] 
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
18 months agoresolved: use right conditionalization when setting unicast ifindex on UDP sockets
Lennart Poettering [Fri, 18 Nov 2022 15:52:01 +0000 (16:52 +0100)] 
resolved: use right conditionalization when setting unicast ifindex on UDP sockets

18 months agonspawn: allow sched_rr_get_interval_time64 through seccomp filter
Sam James [Fri, 18 Nov 2022 07:18:18 +0000 (07:18 +0000)] 
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

18 months agosysupdate: Support volatile-root for finding the root partition
reuben olinsky [Tue, 1 Nov 2022 05:58:52 +0000 (22:58 -0700)] 
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.

18 months agoupdate TODO
Lennart Poettering [Fri, 18 Nov 2022 13:58:30 +0000 (14:58 +0100)] 
update TODO

18 months agoMerge pull request #25410 from DaanDeMeyer/mkfs-xfs-fixes
Lennart Poettering [Fri, 18 Nov 2022 13:45:48 +0000 (14:45 +0100)] 
Merge pull request #25410 from DaanDeMeyer/mkfs-xfs-fixes

Followups for #25400

18 months agoboot/measure: fix oom check
Li kunyu [Fri, 18 Nov 2022 07:10:24 +0000 (16:10 +0900)] 
boot/measure: fix oom check

18 months agotest: fix the default timeout values described in README.testsuite 25389/head
Franck Bui [Tue, 15 Nov 2022 10:00:22 +0000 (11:00 +0100)] 
test: fix the default timeout values described in README.testsuite

Unlike it was described, the default is 30 min.

18 months agomeson: install test-kernel-install only when -Dkernel-install=true
Franck Bui [Tue, 15 Nov 2022 08:04:42 +0000 (09:04 +0100)] 
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.

18 months agotests: update install_suse_systemd()
Franck Bui [Fri, 18 Nov 2022 09:18:19 +0000 (10:18 +0100)] 
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

18 months agofuzz: fuzz-compress: fix copy-and-paste error: buf -> buf2 (#25431)
Li kunyu [Fri, 18 Nov 2022 06:03:41 +0000 (06:03 +0000)] 
fuzz: fuzz-compress: fix copy-and-paste error: buf -> buf2 (#25431)

18 months agoMerge pull request #25414 from zx2c4-forks/krngseed
Luca Boccassi [Thu, 17 Nov 2022 18:49:40 +0000 (19:49 +0100)] 
Merge pull request #25414 from zx2c4-forks/krngseed

EFI random seed post #25319 review fixups

18 months agokmod-setup: Make sure the tpm module is available early
Daan De Meyer [Thu, 17 Nov 2022 11:35:46 +0000 (12:35 +0100)] 
kmod-setup: Make sure the tpm module is available early

Required for early boot services such as systemd-pcrphase-sysinit
which need early access to the tpm.

18 months agoUpdate NEWS and TODO with sd-boot random seed developments
Jason A. Donenfeld [Thu, 17 Nov 2022 15:35:12 +0000 (16:35 +0100)] 
Update NEWS and TODO with sd-boot random seed developments

18 months agoMerge pull request #25333 from yuwata/find-esp-part-entry-scheme
Lennart Poettering [Thu, 17 Nov 2022 14:28:54 +0000 (15:28 +0100)] 
Merge pull request #25333 from yuwata/find-esp-part-entry-scheme

find-esp: downgrade and ignore error on retrieving PART_ENTRY_SCHEME

18 months agosignal-util: add common implementation for propagating a signal
Lennart Poettering [Wed, 16 Nov 2022 17:54:29 +0000 (18:54 +0100)] 
signal-util: add common implementation for propagating a signal

i.e. let's add a common logic to be called from a signal handler to
raise the passed signal again.

Follow-up for: #25399

18 months agohwdb: fix Compaq N14KP6 key toggle touchpad (#25404)
Edson Juliano Drosdeck [Thu, 17 Nov 2022 13:37:08 +0000 (10:37 -0300)] 
hwdb: fix Compaq N14KP6 key toggle touchpad (#25404)

18 months agolog: Remove log_ratelimit_debug() macros
Daan De Meyer [Thu, 17 Nov 2022 09:25:06 +0000 (10:25 +0100)] 
log: Remove log_ratelimit_debug() macros

These don't make sense anymore since we disable log ratelimiting
when logging at debug level.

18 months agorepart: Write temporary LUKS header to /var/tmp instead of /tmp 25410/head
Daan De Meyer [Thu, 17 Nov 2022 13:15:28 +0000 (14:15 +0100)] 
repart: Write temporary LUKS header to /var/tmp instead of /tmp

This is a relatively large file so let's not create it in memory.

18 months agoFollowups for aa6aa81c1e2fa0d35f91545d440ce5a31e1a43df
Daan De Meyer [Wed, 16 Nov 2022 16:33:31 +0000 (17:33 +0100)] 
Followups for aa6aa81c1e2fa0d35f91545d440ce5a31e1a43df

18 months agotmpfile-util: Introduce fopen_temporary_child()
Daan De Meyer [Thu, 17 Nov 2022 13:12:48 +0000 (14:12 +0100)] 
tmpfile-util: Introduce fopen_temporary_child()

Instead of having fopen_temporary() create the file either next
to an existing file or in tmp/, let's split this up clearly into
two different functions, one for creating temporary files next to
existing files, and one for creating a temporary file in a directory.

18 months agonetwork: tc-cake: add support to specify RTT
Yu Watanabe [Thu, 17 Nov 2022 09:11:38 +0000 (18:11 +0900)] 
network: tc-cake: add support to specify RTT

18 months agoboot: only use __builtin_object_size with -O>0 25414/head
Jason A. Donenfeld [Wed, 16 Nov 2022 18:46:41 +0000 (19:46 +0100)] 
boot: only use __builtin_object_size with -O>0

__builtin_object_size() returns -1 with -O0, so disable this and warn
about it instead.

18 months agoboot: do not truncate random seed file
Jason A. Donenfeld [Wed, 16 Nov 2022 18:34:53 +0000 (19:34 +0100)] 
boot: do not truncate random seed file

There are concerns about the FAT file system driver exploding if we try
to do this, so just leave the bytes zeroed out instead.

18 months agorandom-seed: handle post-merge review nits
Jason A. Donenfeld [Wed, 16 Nov 2022 18:27:50 +0000 (19:27 +0100)] 
random-seed: handle post-merge review nits

These are various misc things that came up after merging.

18 months agoHandle MACHINE_ID=uninitialized
Marcus Schäfer [Wed, 16 Nov 2022 15:25:08 +0000 (16:25 +0100)] 
Handle MACHINE_ID=uninitialized

systemd supports /etc/machine-id to be set to: uninitialized
In this case the expectation is that systemd creates a new
machine ID and replaces the value 'uninitialized' with the
effective machine id. In the scope of kernel-install we
should also enforce the creation of a new machine id in this
condition

18 months agopcrphase: add $SYSTEMD_PCRPHASE_STUB_VERIFY env var for overriding stub check
Lennart Poettering [Mon, 14 Nov 2022 16:26:45 +0000 (17:26 +0100)] 
pcrphase: add $SYSTEMD_PCRPHASE_STUB_VERIFY env var for overriding stub check

18 months agoshared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warning
Vitaly Kuznetsov [Tue, 15 Nov 2022 13:57:23 +0000 (14:57 +0100)] 
shared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warning

systemd-cryptenroll complains (but succeeds!) upon binding to a signed PCR
policy:

$ systemd-cryptenroll --unlock-key-file=/tmp/passphrase --tpm2-device=auto
  --tpm2-public-key=... --tpm2-signature=..." /tmp/tmp.img

ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x40000001
ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x4000000
New TPM2 token enrolled as key slot 1.

The problem seems to be that Esys_LoadExternal() function from tpm2-tss
expects a 'ESYS_TR_RH*' constant specifying the requested hierarchy and not
a 'TPM2_RH_*' one (see Esys_LoadExternal() -> Esys_LoadExternal_Async() ->
iesys_handle_to_tpm_handle() call chain).

It all works because Esys_LoadExternal_Async() falls back to using the
supplied values when iesys_handle_to_tpm_handle() fails:

    r = iesys_handle_to_tpm_handle(hierarchy, &tpm_hierarchy);
    if (r != TSS2_RC_SUCCESS) {
        ...
        tpm_hierarchy = hierarchy;
    }

Note, TPM2_RH_OWNER was used on purpose to support older tpm2-tss versions
(pre https://github.com/tpm2-software/tpm2-tss/pull/1531), use meson magic
to preserve compatibility.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
18 months agoMerge pull request #25399 from DaanDeMeyer/siginfo-crash
Lennart Poettering [Wed, 16 Nov 2022 17:42:07 +0000 (18:42 +0100)] 
Merge pull request #25399 from DaanDeMeyer/siginfo-crash

crash-handler: Make sure we propagate the original siginfo

18 months agoMerge pull request #25096 from DaanDeMeyer/journald-log-fixes
Daan De Meyer [Wed, 16 Nov 2022 15:40:00 +0000 (16:40 +0100)] 
Merge pull request #25096 from DaanDeMeyer/journald-log-fixes

journal: Ratelimit more journald log messages

18 months agocrash-handler: Make sure we propagate the original siginfo 25399/head
Daan De Meyer [Sun, 5 Jun 2022 12:25:22 +0000 (14:25 +0200)] 
crash-handler: Make sure we propagate the original siginfo

If we call raise(), we lose the information from the original signal.
If we use rt_sigqueueinfo(), the original siginfo gets reused which
is helpful when debugging crashes.

18 months agosigbus: Add fallback in case rt_tgsiqqueueinfo() fails
Daan De Meyer [Wed, 16 Nov 2022 14:06:55 +0000 (15:06 +0100)] 
sigbus: Add fallback in case rt_tgsiqqueueinfo() fails

18 months agomkfs-util: Add support for rootless xfs population
Daan De Meyer [Wed, 16 Nov 2022 10:17:52 +0000 (11:17 +0100)] 
mkfs-util: Add support for rootless xfs population

We use mkfs.xfs's protofile (-p) support to achieve this. The
protofile is a description of the files that should be copied into
the filesystem. The format is described in the manpage of mkfs.xfs.

18 months agoMerge pull request #25319 from zx2c4-forks/krngseed
Luca Boccassi [Wed, 16 Nov 2022 14:07:54 +0000 (15:07 +0100)] 
Merge pull request #25319 from zx2c4-forks/krngseed

boot: implement kernel EFI RNG seed protocol with proper hashing

18 months agosigbus: Make sure the signal is delivered to the same thread
Daan De Meyer [Wed, 16 Nov 2022 14:05:24 +0000 (15:05 +0100)] 
sigbus: Make sure the signal is delivered to the same thread

18 months agomissing_syscall: Add rt_tgsigqueueinfo()
Daan De Meyer [Wed, 16 Nov 2022 14:03:11 +0000 (15:03 +0100)] 
missing_syscall: Add rt_tgsigqueueinfo()

18 months agoMerge pull request #25310 from jlinton/fpdt_dev_mem_alt
Lennart Poettering [Wed, 16 Nov 2022 13:55:17 +0000 (14:55 +0100)] 
Merge pull request #25310 from jlinton/fpdt_dev_mem_alt

acpi-fpdt: Use kernel fpdt parsing

18 months agoMerge pull request #24855 from kraxel/qemu
Lennart Poettering [Wed, 16 Nov 2022 13:53:42 +0000 (14:53 +0100)] 
Merge pull request #24855 from kraxel/qemu

better qemu support (handle direct kernel boot etc).

18 months agoMerge pull request #25393 from poettering/tpm2-override
Lennart Poettering [Wed, 16 Nov 2022 13:30:26 +0000 (14:30 +0100)] 
Merge pull request #25393 from poettering/tpm2-override

tpm2-util: force default TCTI to be "device" with parameter "/dev/tpm…

18 months agosystemd-boot man page: add section for virtual machines 24855/head
Gerd Hoffmann [Tue, 4 Oct 2022 13:01:39 +0000 (15:01 +0200)] 
systemd-boot man page: add section for virtual machines

18 months agoboot: improve support for qemu
Gerd Hoffmann [Fri, 9 Sep 2022 11:12:04 +0000 (13:12 +0200)] 
boot: improve support for qemu

systemd-boot expects being loaded from ESP and is quite unhappy in case
the loaded image device path is something else.  When running on qemu
this can easily happen though.  Case one is direct kernel boot, i.e.
loading via 'qemu -kernel systemd-bootx64.efi'.  Case two is sd-boot
being added to the ovmf firmware image and being loaded from there.

This patch detects both cases and goes inspect all file systems known to
the firmware, trying to find the ESP.  When present the
VMMBootOrderNNNN variables are used to inspect the file systems in the
given order.

18 months agoMerge pull request #24555 from medhefgo/bootctl
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 11:27:30 +0000 (12:27 +0100)] 
Merge pull request #24555 from medhefgo/bootctl

bootctl: Small improvements

18 months agolocalectl,analyze: some minor vertical table rework fixes
Lennart Poettering [Fri, 11 Nov 2022 13:32:51 +0000 (14:32 +0100)] 
localectl,analyze: some minor vertical table rework fixes

Follow-up for #25339

18 months agolog: Disable log rate limiting if debug logging is enabled 25096/head
Daan De Meyer [Wed, 16 Nov 2022 10:37:14 +0000 (11:37 +0100)] 
log: Disable log rate limiting if debug logging is enabled

When debugging, it makes sense to not do any rate limiting at all.

18 months agoMerge pull request #24944 from DaanDeMeyer/repart-rootless
Daan De Meyer [Wed, 16 Nov 2022 08:09:06 +0000 (09:09 +0100)] 
Merge pull request #24944 from DaanDeMeyer/repart-rootless

repart: Add support for running without root privileges

18 months agoRevert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL"
Daan De Meyer [Mon, 14 Nov 2022 11:45:47 +0000 (12:45 +0100)] 
Revert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL"

This commit broke backwards compatibility so let's revert it until
we find a better solution.

This reverts commit 977ad21b5b8f6323515297bd8995dcaaca0905df.

18 months agoFix reading /etc/machine-id in kernel-install (#25388)
Marcus Schäfer [Tue, 15 Nov 2022 23:17:19 +0000 (00:17 +0100)] 
Fix reading /etc/machine-id in kernel-install (#25388)

* Fix reading /etc/machine-id in kernel-install

The kernel-install script has code to read the contents of
/etc/machine-id into the MACHINE_ID variable. Depending
on the variable content kernel-install either logs the
value or creates a new machine id via 'systemd-id128 new'.
In that logic there is one issue. If the file /etc/machine-id
exists but is empty, the script tries to call read on an
empty file which return with an exit code != 0. As the
script code also uses 'set -e', kernel-install will exit at
this point which is unexpected.

The condition of an empty /etc/machine-id file exists for
example when building OS images, which should initialize the
system id on first boot but not staticly inside of the image.
afaik an empty /etc/machine-id is also a common approach
to make systemd indicate that it should create a new system
id. Because of this, the commit makes sure the reading of
/etc/machine-id does not fail in any case such that the
handling of the MACHINE_ID variable takes place.

18 months agoUpdate hostnamectl.xml
angus-p [Tue, 15 Nov 2022 16:11:36 +0000 (16:11 +0000)] 
Update hostnamectl.xml

set-hostname is obsolete

18 months agotpm2: add some extra validation of device string before using it 25393/head
Lennart Poettering [Tue, 15 Nov 2022 22:01:04 +0000 (23:01 +0100)] 
tpm2: add some extra validation of device string before using it

Let's add some extra validation before constructing and using the .so
name to load. This isn't really security sensitive, given that we
used secure_getenv() to get the device string (and it thus should have
been come from a trusted source) but let's better be safe than sorry.

18 months agotpm2-util: force default TCTI to be "device" with parameter "/dev/tpmrm0"
Lennart Poettering [Mon, 14 Nov 2022 16:26:49 +0000 (17:26 +0100)] 
tpm2-util: force default TCTI to be "device" with parameter "/dev/tpmrm0"

Apparently some distros default to tss-abmrd. Let's bypass that and
always go to the kernel resource manager.

abmrd cannot really work for us, since we want to access the TPM already
in earliest boot i.e. in environments the abmrd service is not available
in.

Fixes: #25352
18 months agoMemoryZSwapMax directive to configure new memory.zswap.max cgroup file
Pasha Vorobyev [Fri, 4 Feb 2022 19:49:46 +0000 (11:49 -0800)] 
MemoryZSwapMax directive to configure new memory.zswap.max cgroup file

18 months agorepart: Run most repart integration tests without root privileges 24944/head
Daan De Meyer [Thu, 10 Nov 2022 14:40:00 +0000 (15:40 +0100)] 
repart: Run most repart integration tests without root privileges

To make sure rootless mode keeps working, let's run all repart
integration tests that we can without root privileges. The only ones
we need to keep running with root privileges are the tests that operate
on a block/loop device and those that use --image=.

18 months agorepart: Don't use loop devices when we're not operating on a block device
Daan De Meyer [Sun, 9 Oct 2022 22:14:17 +0000 (00:14 +0200)] 
repart: Don't use loop devices when we're not operating on a block device

When repart is not operating on a block device, if we avoid using
any loop devices at all, it becomes possible to run repart without
needing root privileges.

Note that this also depends on the filesystems in use to support
population without needing root privileges (specifically, squashfs,
ext4 or btrfs).

18 months agorepart: Change mode of temporary root to 755
Daan De Meyer [Thu, 10 Nov 2022 13:32:15 +0000 (14:32 +0100)] 
repart: Change mode of temporary root to 755

Let's make sure regular users can access read/execute files when
we're populating from a temporary root.

18 months agorepart: Fail early if no sources are provided for a read-only filesystem
Daan De Meyer [Wed, 12 Oct 2022 12:53:48 +0000 (14:53 +0200)] 
repart: Fail early if no sources are provided for a read-only filesystem