]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
18 months agotest: add simple test for new --in-memory switch for systemd-dissect 25665/head
Lennart Poettering [Thu, 8 Dec 2022 11:46:41 +0000 (12:46 +0100)] 
test: add simple test for new --in-memory switch for systemd-dissect

18 months agoman: add doc for new --in-memory switch of systemd-dissect
Lennart Poettering [Thu, 8 Dec 2022 11:46:24 +0000 (12:46 +0100)] 
man: add doc for new --in-memory switch of systemd-dissect

18 months agodissect: add a mode for operating on an in-memory copy of a DDI, instead of directly...
Lennart Poettering [Thu, 8 Dec 2022 11:46:09 +0000 (12:46 +0100)] 
dissect: add a mode for operating on an in-memory copy of a DDI, instead of directly on it

This is useful for operating in ephemeral, writable mode on any image,
including read-only ones. It also has the benefit of not keeping the
image file's filesystem busy.

Inspired by the discussions in #25648

18 months agoloop-util: add new loop_device_make_by_path_memory() helper
Lennart Poettering [Thu, 8 Dec 2022 11:45:48 +0000 (12:45 +0100)] 
loop-util: add new loop_device_make_by_path_memory() helper

This uses the new memfd_clone_fd() call to make an in-memory copy of
some file before setting up a loopback block device on it.

18 months agodata-fd-util: add new memfd_clone_fd() helper
Lennart Poettering [Thu, 8 Dec 2022 11:45:26 +0000 (12:45 +0100)] 
data-fd-util: add new memfd_clone_fd() helper

This adds a new helper for cloning any file's contents (or block device contents) into a new memfd.

18 months agocryptsetup: retry TPM2 unseal operation if it fails with TPM2_RC_PCR_CHANGED
Antonio Alvarez Feijoo [Wed, 7 Dec 2022 15:52:27 +0000 (16:52 +0100)] 
cryptsetup: retry TPM2 unseal operation if it fails with TPM2_RC_PCR_CHANGED

Quoting "Trusted Platform Module Library - Part 3: Commands (Rev. 01.59)":

"pcrUpdateCounter – this parameter is updated by TPM2_PolicyPCR(). This value
may only be set once during a policy. Each time TPM2_PolicyPCR() executes, it
checks to see if policySession->pcrUpdateCounter has its default state,
indicating that this is the first TPM2_PolicyPCR(). If it has its default value,
then policySession->pcrUpdateCounter is set to the current value of
pcrUpdateCounter. If policySession->pcrUpdateCounter does not have its default
value and its value is not the same as pcrUpdateCounter, the TPM shall return
TPM_RC_PCR_CHANGED.

If this parameter and pcrUpdateCounter are not the same, it indicates that PCR
have changed since checked by the previous TPM2_PolicyPCR(). Since they have
changed, the previous PCR validation is no longer valid."

The TPM will return TPM_RC_PCR_CHANGED if any PCR value changes (no matter
which) between validating the PCRs binded to the enrollment and unsealing the
HMAC key, so this patch adds a retry mechanism in this case.

Fixes #24906

18 months agoman: mention that DefaultRouteOnDevice= create the IPv4 default route
Yu Watanabe [Thu, 8 Dec 2022 04:17:15 +0000 (13:17 +0900)] 
man: mention that DefaultRouteOnDevice= create the IPv4 default route

And add an example setting for creating an IPv6 default route.

Closes #25440.

18 months agoMerge pull request #25672 from jelly/FirwmwareName
Yu Watanabe [Thu, 8 Dec 2022 07:04:36 +0000 (16:04 +0900)] 
Merge pull request #25672 from jelly/FirwmwareName

Extend hostnamed DMI firmware properties

18 months agoMerge pull request #25564 from poettering/dissect-discover
Yu Watanabe [Thu, 8 Dec 2022 03:29:07 +0000 (12:29 +0900)] 
Merge pull request #25564 from poettering/dissect-discover

systemd-dissect: add simple "--discover" command

18 months agoMerge pull request #25666 from poettering/selinux-getconf-fixup
Yu Watanabe [Thu, 8 Dec 2022 03:23:29 +0000 (12:23 +0900)] 
Merge pull request #25666 from poettering/selinux-getconf-fixup

selinux getXYZcon() NULL return fixes

18 months agooomd: print dry run output at INFO level
Jade Lovelace [Wed, 7 Dec 2022 19:14:30 +0000 (11:14 -0800)] 
oomd: print dry run output at INFO level

Otherwise, the dry run isn't much use since it would be logged at debug
and not seen.

18 months agotest: wait for the monitoring service to become active
Frantisek Sumsal [Wed, 7 Dec 2022 19:44:07 +0000 (20:44 +0100)] 
test: wait for the monitoring service to become active

Otherwise we might start querying resolved too early, causing the
monitoring service to miss stuff:

```
[ 1103.149474] testsuite-75.sh[35]: + systemd-run -u resmontest.service -p Type=notify resolvectl monitor
[ 1103.353803] testsuite-75.sh[423]: Running as unit: resmontest.service
[ 1103.353989] testsuite-75.sh[35]: + knotc zone-begin test.
[ 1103.354160] testsuite-75.sh[425]: OK
...
[ 1103.355298] testsuite-75.sh[35]: + knotc reload
[ 1103.355363] testsuite-75.sh[438]: Reloaded
[ 1103.355536] testsuite-75.sh[35]: + : '--- nss-resolve/nss-myhostname tests'
[ 1103.355536] testsuite-75.sh[35]: + run getent -s resolve hosts ns1.unsigned.test
[ 1103.356127] testsuite-75.sh[443]: + getent -s resolve hosts ns1.unsigned.test
[ 1103.356505] testsuite-75.sh[444]: + tee /tmp/tmp.bXg5Uj5Jkk
[ 1103.359591] resolvectl[424]: → Q: ns1.unsigned.test IN AAAA
[ 1103.359591] resolvectl[424]: ← S: success
[ 1103.359850] testsuite-75.sh[444]: 10.0.0.1        ns1.unsigned.test
[ 1103.359939] resolvectl[424]: → Q: ns1.unsigned.test IN A
[ 1103.359939] resolvectl[424]: ← S: success
[ 1103.359939] resolvectl[424]: ← A: ns1.unsigned.test IN A 10.0.0.1
[ 1103.360149] testsuite-75.sh[35]: + grep -qE '^10\.0\.0\.1\s+ns1\.unsigned\.test' /tmp/tmp.bXg5Uj5Jkk
[ 1103.362119] systemd[1]: Starting resmontest.service...
[ 1103.362633] systemd[1]: Started resmontest.service.
[ 1103.363263] testsuite-75.sh[35]: + monitor_check_rr 'ns1.unsigned.test IN A 10.0.0.1'
[ 1103.363263] testsuite-75.sh[35]: + local 'match=ns1.unsigned.test IN A 10.0.0.1'
[ 1103.363377] testsuite-75.sh[35]: + set +o pipefail
[ 1103.363836] testsuite-75.sh[458]: + journalctl -u resmontest.service -f --full
[ 1103.364042] testsuite-75.sh[459]: + grep -m1 'ns1.unsigned.test IN A 10.0.0.1'
...
Trying to halt container. Send SIGTERM again to trigger immediate termination.
Container TEST-75 terminated by signal KILL.
```

18 months agojournald: prevent segfault on empty attr/current
Space Meyer [Wed, 7 Dec 2022 13:11:30 +0000 (14:11 +0100)] 
journald: prevent segfault on empty attr/current

getpidcon() might set con to NULL, even when it returned a 0 return
code[0]. The subsequent strlen(con) will then cause a segfault.

Alternatively the behaviour could also be changed in getpidcon. I
don't know whether the libselinux folks are comitted to the current
behaviour, but the getpidcon man page doesn't really make it obvious
this case could happen.

[0] https://github.com/SELinuxProject/selinux/blob/fb7f35495fbad468d6efa76c5fed727659903038/libselinux/src/procattr.c#L155-L158

18 months agoMerge pull request #25632 from keszybz/chroot-fix
Luca Boccassi [Wed, 7 Dec 2022 19:51:47 +0000 (20:51 +0100)] 
Merge pull request #25632 from keszybz/chroot-fix

Add trivial check for preset operation in chroot

18 months agoMerge pull request #25465 from DaanDeMeyer/repart-workspace
Luca Boccassi [Wed, 7 Dec 2022 19:45:23 +0000 (20:45 +0100)] 
Merge pull request #25465 from DaanDeMeyer/repart-workspace

repart: Cleanup created files on failure

18 months agohostnamed: expose FirmwareDate dbus property 25672/head
Jelle van der Waa [Wed, 7 Dec 2022 16:33:50 +0000 (17:33 +0100)] 
hostnamed: expose FirmwareDate dbus property

Expose /sys/class/dmi/id/bios_date as dbus property in hostnamed.

18 months agohostnamed: expose FirmwareVendor as dbus property
Jelle van der Waa [Tue, 6 Dec 2022 17:23:18 +0000 (18:23 +0100)] 
hostnamed: expose FirmwareVendor as dbus property

Expose /sys/class/dmi/id/bios_vendor as dbus property in hostnamed.

18 months agodissect: add simple --discover command 25564/head
Lennart Poettering [Tue, 29 Nov 2022 15:39:06 +0000 (16:39 +0100)] 
dissect: add simple --discover command

18 months agodiscover-image: store image class in Image object too, if known
Lennart Poettering [Tue, 29 Nov 2022 15:40:15 +0000 (16:40 +0100)] 
discover-image: store image class in Image object too, if known

18 months agodiscover-image: add stringification helpers for ImageClass
Lennart Poettering [Tue, 29 Nov 2022 15:38:48 +0000 (16:38 +0100)] 
discover-image: add stringification helpers for ImageClass

18 months agoMerge pull request #25651 from keszybz/man-halt
Luca Boccassi [Wed, 7 Dec 2022 14:49:30 +0000 (15:49 +0100)] 
Merge pull request #25651 from keszybz/man-halt

Deemphasize 'halt' subcommand

18 months agoselinux-setup: minor modernizations 25666/head
Lennart Poettering [Wed, 7 Dec 2022 14:23:02 +0000 (15:23 +0100)] 
selinux-setup: minor modernizations

18 months agoselinux: accept the fact that getxyzcon() can return success and NULL
Lennart Poettering [Wed, 7 Dec 2022 14:20:15 +0000 (15:20 +0100)] 
selinux: accept the fact that getxyzcon() can return success and NULL

Inspired by #25664: let's check explicitly for NULL everywhere we do one
of those getXYZcon() calls.

We usually turn this into EOPNOTSUPP, as when selinux is off (which is
supposed to be the only case this can happen according to selinux docs)
we otherwise return EOPNOTSUPP in that case.

Note that in most cases we have an explicit mac_selinux_use() call
beforehand, hence this should mostly not be triggerable codepaths.

18 months agonetwork: manage addresses in the way the kernel does
Yu Watanabe [Mon, 28 Nov 2022 18:20:33 +0000 (03:20 +0900)] 
network: manage addresses in the way the kernel does

This effectively reverts 5d0030310c134a016321ad8cf0b4ede8b1800d84.

With the commit 5d0030310c134a016321ad8cf0b4ede8b1800d84, networkd manages
addresses with the detailed hash and compare functions. But that causes
networkd cannot detect address update by the kernel or an external tool.
See issue
https://github.com/systemd/systemd/issues/481#issuecomment-1328132401.

With this commit, networkd (again) manages addresses in the way that the
kernel does. Hence, we can correctly detect address update.

18 months agotest-network: try to change MAC address more
Yu Watanabe [Wed, 7 Dec 2022 04:53:37 +0000 (13:53 +0900)] 
test-network: try to change MAC address more

Follow-up for 23b6bf274fc1a46d8778bfc979d3c803d61a1f5c.

18 months agopackit: ignore unpackaged files
Frantisek Sumsal [Wed, 7 Dec 2022 12:04:44 +0000 (13:04 +0100)] 
packit: ignore unpackaged files

It may take a bit for newly introduced binaries/other files to get
properly integrated into the Rawhide specfile, so don't choke up in the
meantime when rpmbuild detects unpackaged files.

18 months agoupdate TODO
Lennart Poettering [Wed, 7 Dec 2022 13:28:36 +0000 (14:28 +0100)] 
update TODO

18 months agoMerge pull request #25502 from keszybz/pam-namespace-add
Luca Boccassi [Wed, 7 Dec 2022 12:01:50 +0000 (13:01 +0100)] 
Merge pull request #25502 from keszybz/pam-namespace-add

Add pam_namespace to user@.service pam stack

18 months agocore: use correct scope of looking up units
Yu Watanabe [Wed, 7 Dec 2022 03:01:59 +0000 (12:01 +0900)] 
core: use correct scope of looking up units

Fixes a bug introduced by 3b3557c410c7910fae0990599dcb82711cf5fbb7.

Fixes #25625.

18 months agoTEST-65: use [[ -v ]] more 25632/head
Zbigniew Jędrzejewski-Szmek [Wed, 7 Dec 2022 08:52:35 +0000 (09:52 +0100)] 
TEST-65: use [[ -v ]] more

It's a bashism, but we use other bash features anyway, and it's cleaner
and much less verbose.

18 months agoTEST-65: check cat-config operation in chroot
Zbigniew Jędrzejewski-Szmek [Mon, 5 Dec 2022 12:52:28 +0000 (13:52 +0100)] 
TEST-65: check cat-config operation in chroot

This verifies the fix in 2075b6dd394e09a0f203b9cc7e3253908397f933.

18 months agoMerge pull request #25648 from keszybz/exitrd
Lennart Poettering [Wed, 7 Dec 2022 10:34:54 +0000 (11:34 +0100)] 
Merge pull request #25648 from keszybz/exitrd

Build systemd-shutdown.standalone

18 months agoman: deemphasize "halt" 25651/head
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 10:27:31 +0000 (11:27 +0100)] 
man: deemphasize "halt"

Systemd documents "halt" as the primary shutdown mechanism, redirecting
"reboot" and "shutdown" to the halt(8), but halt is a really strange and
obsolete concept. Who would want to really keep their machine running after
shutdown? I expect that halting is almost unused. Let's at least make it less
prominent in the docs.

While at it, use "power off" for a verb and "power-off" for noun (but "poweroff"
of the actual command name).

18 months agofuzz-systemctl: adjust size limit
Yu Watanabe [Wed, 7 Dec 2022 02:18:07 +0000 (11:18 +0900)] 
fuzz-systemctl: adjust size limit

Follow-up for 719b7d4dc2bde3a9257e9f6fdcf03239ee2324b6.

The size of the current reproducer is 250KB. Hence, 16KB should be
enough, but still we can test most arguments within the size.

Hopefully fixes oss-fuzz#53552.

18 months agoMerge pull request #25628 from zhangjian3032/dev/fix-set-bond-mac-failed
Yu Watanabe [Wed, 7 Dec 2022 04:34:39 +0000 (13:34 +0900)] 
Merge pull request #25628 from zhangjian3032/dev/fix-set-bond-mac-failed

network: Fix set bond device MAC address failed

18 months agotest-fs-util: Add relative path chase_symlinks() tests
Daan De Meyer [Mon, 5 Dec 2022 10:15:58 +0000 (11:15 +0100)] 
test-fs-util: Add relative path chase_symlinks() tests

18 months agoMerge pull request #25616 from poettering/chase-symlinks-opendir
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 16:10:54 +0000 (17:10 +0100)] 
Merge pull request #25616 from poettering/chase-symlinks-opendir

chase-symlinks/systemctl: let's handle cases without /proc/ better

18 months agogpt: add helpers for deriving data partition from verity or verity sig designator
Lennart Poettering [Wed, 30 Nov 2022 17:55:40 +0000 (18:55 +0100)] 
gpt: add helpers for deriving data partition from verity or verity sig designator

let's add the inverse of the existing partition_verity_of() and
partition_verity_sig_of()

18 months agoMerge pull request #25644 from yuwata/escape-fix-octescape
Frantisek Sumsal [Tue, 6 Dec 2022 15:22:08 +0000 (15:22 +0000)] 
Merge pull request #25644 from yuwata/escape-fix-octescape

escape: fix octescape()

18 months agonetwork: drop REMOVING flag when a netlink message is sent to kernel
Yu Watanabe [Tue, 22 Nov 2022 04:03:55 +0000 (13:03 +0900)] 
network: drop REMOVING flag when a netlink message is sent to kernel

When an interface goes to down, the kernel drops several routes
automatically, and at the same time networkd requests to remove
them, but the kernel sometimes does not respond the requests. Hence,
the routes cannot drop the REMOVING flag, and networkd will never try
to configure other routes which depend on the previously removed
routes even if they are already reconfigured.

With this patch, when networkd sends a request to configure a route
(or any other network settings), REMOVING flag for the route is dropped
without waiting for the reply about the previous remove request, as we
can expect it will appear even if it is already removed or under removing.

Fixes #24999.

18 months agoMerge pull request #25645 from yuwata/boot-fix-false-maybe-uninitialized
Luca Boccassi [Tue, 6 Dec 2022 15:00:10 +0000 (16:00 +0100)] 
Merge pull request #25645 from yuwata/boot-fix-false-maybe-uninitialized

boot: fix false maybe-uninitialized warning

18 months agoImplement --luks-pbkdf-force-iterations for homed
Aidan Dang [Sat, 3 Dec 2022 15:26:13 +0000 (02:26 +1100)] 
Implement --luks-pbkdf-force-iterations for homed

18 months agoman: reword sentence
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 10:16:57 +0000 (11:16 +0100)] 
man: reword sentence

"Such as … suchlike" repeats too much.

18 months agomeson: build a standalone version of systemd-shutdown 25648/head
Zbigniew Jędrzejewski-Szmek [Wed, 30 Nov 2022 08:25:49 +0000 (09:25 +0100)] 
meson: build a standalone version of systemd-shutdown

I'd like to use this as a basis for an exitrd:

When compiled with -Dstandalone-binaries=true -Db_lto=true -Dbuildtype=release,
the new file is 800k. It's more than I'd like, but still quite a bit less
than libsystemd-shared.so, which is 3800k.

18 months agotest: do the --help/--version checks for repart.standalone too
Zbigniew Jędrzejewski-Szmek [Wed, 30 Nov 2022 07:41:13 +0000 (08:41 +0100)] 
test: do the --help/--version checks for repart.standalone too

18 months agotest-network: add test for bond mac address config 25628/head
Jian Zhang [Mon, 5 Dec 2022 10:38:00 +0000 (18:38 +0800)] 
test-network: add test for bond mac address config

Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
18 months agoMerge pull request #25559 from intelfx/work/systemd-importd-quotas
Yu Watanabe [Tue, 6 Dec 2022 05:05:35 +0000 (14:05 +0900)] 
Merge pull request #25559 from intelfx/work/systemd-importd-quotas

import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd

18 months agoboot: fix false maybe-uninitialized warning 25645/head
Yu Watanabe [Tue, 6 Dec 2022 03:57:43 +0000 (12:57 +0900)] 
boot: fix false maybe-uninitialized warning

Fixes #25641.

18 months agoboot: cleanups for efivar_get() and friends
Yu Watanabe [Tue, 6 Dec 2022 04:06:57 +0000 (13:06 +0900)] 
boot: cleanups for efivar_get() and friends

- rename function arguments for storing results, and support the case
  that they are NULL,
- return earlier on error,
- always validate read size in efivar_get_uint32_le() and efivar_get_uint64_le().

18 months agodissect: show color in log output
Lennart Poettering [Fri, 2 Dec 2022 14:02:44 +0000 (15:02 +0100)] 
dissect: show color in log output

18 months agotest: add basic tests for octescape() 25644/head
Yu Watanabe [Tue, 6 Dec 2022 03:00:45 +0000 (12:00 +0900)] 
test: add basic tests for octescape()

18 months agoescape: fix wrong octescape of bad character
Yu Watanabe [Tue, 6 Dec 2022 03:00:41 +0000 (12:00 +0900)] 
escape: fix wrong octescape of bad character

Fixes a bug introduced by 95052df3760523e1f3bb9705c918d85aae7fb431.

This also makes octescape() support NULL or zero length string.

Fixes [oss-fuzz#54059](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54059).

Fixes #25643.

18 months agojournald: fix build error
Luca Boccassi [Tue, 6 Dec 2022 01:06:19 +0000 (01:06 +0000)] 
journald: fix build error

Follow-up for: 379864f89079a92ff09917e25b3aea0fadd228ac

Two PRs clashed with each other and were merged before we noticed

18 months agoMerge pull request #25638 from bluca/rate_limit_config
Luca Boccassi [Tue, 6 Dec 2022 01:07:47 +0000 (02:07 +0100)] 
Merge pull request #25638 from bluca/rate_limit_config

pid1: add env var to override default mount rate limit burst

18 months agoMerge pull request #25513 from brauner/pivot_root.nspawn
Luca Boccassi [Tue, 6 Dec 2022 00:51:51 +0000 (01:51 +0100)] 
Merge pull request #25513 from brauner/pivot_root.nspawn

nspawn: support pivot_root()

18 months agolog: Switch logging to runtime when FS becomes read-only
Richard Phibel [Mon, 5 Dec 2022 12:40:41 +0000 (13:40 +0100)] 
log: Switch logging to runtime when FS becomes read-only

The journal has a mechanism to log to the runtime journal if it fails to
log to the system journal. This mechanism is not triggered when the file
system becomes read-only. We enable it here.

When appending an entry fails if shall_try_append_again returns true,
the journal is rotated. If the FS is read-only, rotation will fail and
s->system_journal will be set to NULL. After that, when find_journal
will try to open the journal since s->system_journal will be NULL, it
will open the runtime journal.

18 months agoMerge pull request #25633 from DaanDeMeyer/journald-another-ratelimit
Luca Boccassi [Mon, 5 Dec 2022 21:08:25 +0000 (22:08 +0100)] 
Merge pull request #25633 from DaanDeMeyer/journald-another-ratelimit

journald: Ratelimit a few more log messages

18 months agopid1: add env var to override default mount rate limit burst 25638/head
Luca Boccassi [Mon, 5 Dec 2022 21:05:54 +0000 (21:05 +0000)] 
pid1: add env var to override default mount rate limit burst

I am hitting the rate limit on a busy system with low resources, and
it stalls the boot process which is Very Bad (TM).

18 months agodoc: CentOS is EOL use CentOS stream
Jan Macku [Mon, 5 Dec 2022 17:19:27 +0000 (18:19 +0100)] 
doc: CentOS is EOL use CentOS stream

18 months agonspawn: split mount tunnel setup 25513/head
Christian Brauner [Mon, 5 Dec 2022 17:34:00 +0000 (18:34 +0100)] 
nspawn: split mount tunnel setup

Before we supported pivot_root() nspawn used to make the rootfs shared
before setting up the mount tunnel. So it was safe for it to just turn
it into a dependent mount during setup.

However, we cannot do this anymore because of the requirements
pivot_root() has. After the pivot_root() we will make the rootfs shared
recursively. If we turned the mount tunnel into dependent mount before
mount_switch_root() this will have the consequence that it becomes a
shared mount within the same peer group as the rootfs. So no mounts will
propagate into the container from the host anymore.

To fix this we split setting up the mount tunnel and making it active
into two steps. Setting up the mount tunnel is performed before
mount_switch_root() and activating it afterwards. Note that this works
because turning a shared mount into a shared mount is a nop. IOW, no new
peer group will be allocated.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
18 months agonspawn: mount temporary visible procfs and sysfs instance
Christian Brauner [Mon, 28 Nov 2022 11:36:47 +0000 (12:36 +0100)] 
nspawn: mount temporary visible procfs and sysfs instance

In order to mount procfs and sysfs in an unprivileged container the
kernel requires that a fully visible instance is already present in the
target mount namespace. Mount one here so the inner child can mount its
own  instances. Later we umount the temporary  instances created here
before we actually exec the payload. Since the rootfs is shared the
umount will propagate into the container. Note, the inner child wouldn't
be able to unmount the  instances on its own since it doesn't own the
originating mount namespace. IOW, the outer child needs to do this.

So far nspawn didn't run into this issue because it used MS_MOVE which
meant that the shadow mount tree pinned a procfs and sysfs instance
which the kernel would find. The shadow mount tree is gone with proper
pivot_root() semantics.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
18 months agonspawn: support pivot_root()
Christian Brauner [Thu, 24 Nov 2022 09:45:24 +0000 (10:45 +0100)] 
nspawn: support pivot_root()

In order to support pivot_root() we need to move mount propagation
changes after the pivot_root(). While MS_MOVE requires the source mount
to not be a shared mount pivot_root() also requires the target mount to
not be a shared mount. This guarantees that pivot_root() doesn't leak
any mounts.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
18 months agoMerge pull request #25639 from jamacku/update-contributing
Luca Boccassi [Mon, 5 Dec 2022 16:53:14 +0000 (17:53 +0100)] 
Merge pull request #25639 from jamacku/update-contributing

doc: update link to systemd-rhel GitHub repository - `CONTRIBUTING.md`

18 months agodoc: fix markdown-lint issues in `CONTRIBUTING.md` 25639/head
Jan Macku [Mon, 5 Dec 2022 15:31:45 +0000 (16:31 +0100)] 
doc: fix markdown-lint issues in `CONTRIBUTING.md`

18 months agodoc: update link to systemd-rhel GitHub repo
Jan Macku [Mon, 5 Dec 2022 15:29:13 +0000 (16:29 +0100)] 
doc: update link to systemd-rhel GitHub repo

systemd-rhel GitHub repository has been moved to new location:

- https://github.com/redhat-plumbers

18 months agotest: double default image size
Luca Boccassi [Mon, 5 Dec 2022 12:52:19 +0000 (12:52 +0000)] 
test: double default image size

I am now hitting the 500MB limit on Debian stable.

18 months agojournal: Ratelimit more log messages 25633/head
Daan De Meyer [Mon, 5 Dec 2022 13:30:44 +0000 (14:30 +0100)] 
journal: Ratelimit more log messages

Followup for 8522691d4da.

18 months agojournal: Use shared log ratelimit constant
Daan De Meyer [Mon, 5 Dec 2022 13:29:29 +0000 (14:29 +0100)] 
journal: Use shared log ratelimit constant

Instead of maintaining two different constants, move the constant
to journal-internal.h and share it between files.

18 months agoMerge pull request #25537 from evverx/fuzz-resource-records
Zbigniew Jędrzejewski-Szmek [Mon, 5 Dec 2022 12:41:38 +0000 (13:41 +0100)] 
Merge pull request #25537 from evverx/fuzz-resource-records

tests: fuzz dns resource records

18 months agonetwork: Fix set bond device MAC address failed
Jian Zhang [Fri, 2 Dec 2022 12:08:38 +0000 (20:08 +0800)] 
network: Fix set bond device MAC address failed

Issue:
When device is in bond mode and booting up, there is a probability of
set bond MAC address failed due to `Device or resource busy` error.

In systemd-networkd, set MAC address steps are:
1. Try to set MAC address to device.
2. If failed with `Device or resource busy`, then `Down` the device.
3. Try to set MAC address to device again.

Currently, Even down the bond device, the bond device is still return
`Device or resource busy` error. So the MAC address set failed.

The root cause is that this not enough to down the bond device. We need
to down all the slaves of the bond device.
About this descprition, we could use those commands to check:
```shell
We have two network devices: eth0, bond1, eth0 is slave of bond1.
They are all up.

1. Down bond1, and set MAC address to bond1.
~# ip link set bond1 down
~# ip link set bond1 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Device or resource busy

2. Down eth0, and set MAC address to bond1.
~# ip link set eth0 down
~# ip link set bond1 address 00:11:22:33:44:55
Set okay.
```

Fix:
When setting the mac for the second time, if the device kind is bond,
then we need to down the slave devices of bond device.

Tested: Verified in a long time test( reboot cycles ).

Fixes: #25627
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
18 months agoacl-util: several cleanups
Yu Watanabe [Mon, 5 Dec 2022 06:32:32 +0000 (15:32 +0900)] 
acl-util: several cleanups

- add missing assertions,
- rename function arguments for storing result,
- rename variables which conflict our macros,
- always initialize function arguments for results on success.

18 months agoMerge pull request #25437 from YHNdnzj/systemctl-disable-warn-statically-enabled...
Zbigniew Jędrzejewski-Szmek [Mon, 5 Dec 2022 09:27:24 +0000 (10:27 +0100)] 
Merge pull request #25437 from YHNdnzj/systemctl-disable-warn-statically-enabled-services

systemctl: warn if trying to disable a unit with no install info

18 months agochase-symlinks: Fix regression from 5bc244aaa90211ccd8370535274c266cdff6a1cb
Daan De Meyer [Wed, 30 Nov 2022 10:37:31 +0000 (11:37 +0100)] 
chase-symlinks: Fix regression from 5bc244aaa90211ccd8370535274c266cdff6a1cb

Previously, chase_symlinks() always returned an absolute path, which
changed after 5bc244aaa90211ccd8370535274c266cdff6a1cb. This commit
fixes chase_symlinks() so it returns absolute paths all the time again.

18 months agopstore: fixes for dmesg.txt reconstruction
Eric DeVolder [Mon, 21 Nov 2022 16:27:27 +0000 (11:27 -0500)] 
pstore: fixes for dmesg.txt reconstruction

This patch fixes problems with the re-assembly of the dmesg
from the records stored in pstore.

The current code simply ignores the last 6 characters of the
file name to form a base record id, which then groups any
pstore files with this base id into the reconstructed dmesg.txt.
This approach fails when the following oops generated the
following in pstore:

 -rw-------.  1 root root  1808 Oct 27 22:07 dmesg-efi-166692286101001
 -rw-------.  1 root root  1341 Oct 27 22:07 dmesg-efi-166692286101002
 -rw-------.  1 root root  1812 Oct 27 22:07 dmesg-efi-166692286102001
 -rw-------.  1 root root  1820 Oct 27 22:07 dmesg-efi-166692286102002
 -rw-------.  1 root root  1807 Oct 27 22:07 dmesg-efi-166692286103001
 -rw-------.  1 root root  1791 Oct 27 22:07 dmesg-efi-166692286103002
 -rw-------.  1 root root  1773 Oct 27 22:07 dmesg-efi-166692286104001
 -rw-------.  1 root root  1801 Oct 27 22:07 dmesg-efi-166692286104002
 -rw-------.  1 root root  1821 Oct 27 22:07 dmesg-efi-166692286105001
 -rw-------.  1 root root  1809 Oct 27 22:07 dmesg-efi-166692286105002
 -rw-------.  1 root root  1804 Oct 27 22:07 dmesg-efi-166692286106001
 -rw-------.  1 root root  1817 Oct 27 22:07 dmesg-efi-166692286106002
 -rw-------.  1 root root  1792 Oct 27 22:07 dmesg-efi-166692286107001
 -rw-------.  1 root root  1810 Oct 27 22:07 dmesg-efi-166692286107002
 -rw-------.  1 root root  1717 Oct 27 22:07 dmesg-efi-166692286108001
 -rw-------.  1 root root  1808 Oct 27 22:07 dmesg-efi-166692286108002
 -rw-------.  1 root root  1764 Oct 27 22:07 dmesg-efi-166692286109001
 -rw-------.  1 root root  1765 Oct 27 22:07 dmesg-efi-166692286109002
 -rw-------.  1 root root  1796 Oct 27 22:07 dmesg-efi-166692286110001
 -rw-------.  1 root root  1816 Oct 27 22:07 dmesg-efi-166692286110002
 -rw-------.  1 root root  1793 Oct 27 22:07 dmesg-efi-166692286111001
 -rw-------.  1 root root  1751 Oct 27 22:07 dmesg-efi-166692286111002
 -rw-------.  1 root root  1813 Oct 27 22:07 dmesg-efi-166692286112001
 -rw-------.  1 root root  1786 Oct 27 22:07 dmesg-efi-166692286112002
 -rw-------.  1 root root  1754 Oct 27 22:07 dmesg-efi-166692286113001
 -rw-------.  1 root root  1752 Oct 27 22:07 dmesg-efi-166692286113002
 -rw-------.  1 root root  1803 Oct 27 22:07 dmesg-efi-166692286114001
 -rw-------.  1 root root  1759 Oct 27 22:07 dmesg-efi-166692286114002
 -rw-------.  1 root root  1805 Oct 27 22:07 dmesg-efi-166692286115001
 -rw-------.  1 root root  1787 Oct 27 22:07 dmesg-efi-166692286115002
 -rw-------.  1 root root  1815 Oct 27 22:07 dmesg-efi-166692286116001
 -rw-------.  1 root root  1771 Oct 27 22:07 dmesg-efi-166692286116002
 -rw-------.  1 root root  1816 Oct 27 22:07 dmesg-efi-166692286117002
 -rw-------.  1 root root  1388 Oct 27 22:07 dmesg-efi-166692286701003
 -rw-------.  1 root root  1824 Oct 27 22:07 dmesg-efi-166692286702003
 -rw-------.  1 root root  1795 Oct 27 22:07 dmesg-efi-166692286703003
 -rw-------.  1 root root  1805 Oct 27 22:07 dmesg-efi-166692286704003
 -rw-------.  1 root root  1813 Oct 27 22:07 dmesg-efi-166692286705003
 -rw-------.  1 root root  1821 Oct 27 22:07 dmesg-efi-166692286706003
 -rw-------.  1 root root  1814 Oct 27 22:07 dmesg-efi-166692286707003
 -rw-------.  1 root root  1812 Oct 27 22:07 dmesg-efi-166692286708003
 -rw-------.  1 root root  1769 Oct 27 22:07 dmesg-efi-166692286709003
 -rw-------.  1 root root  1820 Oct 27 22:07 dmesg-efi-166692286710003
 -rw-------.  1 root root  1755 Oct 27 22:07 dmesg-efi-166692286711003
 -rw-------.  1 root root  1790 Oct 27 22:07 dmesg-efi-166692286712003
 -rw-------.  1 root root  1756 Oct 27 22:07 dmesg-efi-166692286713003
 -rw-------.  1 root root  1763 Oct 27 22:07 dmesg-efi-166692286714003
 -rw-------.  1 root root  1791 Oct 27 22:07 dmesg-efi-166692286715003
 -rw-------.  1 root root  1775 Oct 27 22:07 dmesg-efi-166692286716003
 -rw-------.  1 root root  1820 Oct 27 22:07 dmesg-efi-166692286717003

The "reconstructed" dmesg.txt that resulted from the above contained
the following (ignoring actual contents, just providing the Part info):

 Emergency#3 Part17
 Emergency#3 Part16
 Emergency#3 Part15
 Emergency#3 Part14
 Emergency#3 Part13
 Emergency#3 Part12
 Emergency#3 Part11
 Emergency#3 Part10
 Emergency#3 Part9
 Emergency#3 Part8
 Emergency#3 Part7
 Emergency#3 Part6
 Emergency#3 Part5
 Emergency#3 Part4
 Emergency#3 Part3
 Emergency#3 Part2
 Emergency#3 Part1
 Panic#2 Part17
 Panic#2 Part16
 Oops#1 Part16
 Panic#2 Part15
 Oops#1 Part15
 Panic#2 Part14
 Oops#1 Part14
 Panic#2 Part13
 Oops#1 Part13
 Panic#2 Part12
 Oops#1 Part12
 Panic#2 Part11
 Oops#1 Part11
 Panic#2 Part10
 Oops#1 Part10
 Panic#2 Part9
 Oops#1 Part9
 Panic#2 Part8
 Oops#1 Part8
 Panic#2 Part7
 Oops#1 Part7
 Panic#2 Part6
 Oops#1 Part6
 Panic#2 Part5
 Oops#1 Part5
 Panic#2 Part4
 Oops#1 Part4
 Panic#2 Part3
 Oops#1 Part3
 Panic#2 Part2
 Oops#1 Part2
 Panic#2 Part1
 Oops#1 Part1

The above is a interleaved mess of three dmesg dumps.

This patch fixes the above problems, and simplifies the dmesg
reconstruction process. The code now distinguishes between
records on EFI vs ERST, which have differently formatted
record identifiers. Using knowledge of the format of the
record ids allows vastly improved reconstruction process.

With this change in place, the above pstore records now
result in the following:

 # ls -alR /var/lib/systemd/pstore
 1666922861:
 total 8
 drwxr-xr-x. 4 root root   28 Nov 18 14:58 .
 drwxr-xr-x. 7 root root  144 Nov 18 14:58 ..
 drwxr-xr-x. 2 root root 4096 Nov 18 14:58 001
 drwxr-xr-x. 2 root root 4096 Nov 18 14:58 002

 1666922861/001:
 total 100
 drwxr-xr-x. 2 root root  4096 Nov 18 14:58 .
 drwxr-xr-x. 4 root root    28 Nov 18 14:58 ..
 -rw-------. 1 root root  1808 Oct 27 22:07 dmesg-efi-166692286101001
 -rw-------. 1 root root  1812 Oct 27 22:07 dmesg-efi-166692286102001
 -rw-------. 1 root root  1807 Oct 27 22:07 dmesg-efi-166692286103001
 -rw-------. 1 root root  1773 Oct 27 22:07 dmesg-efi-166692286104001
 -rw-------. 1 root root  1821 Oct 27 22:07 dmesg-efi-166692286105001
 -rw-------. 1 root root  1804 Oct 27 22:07 dmesg-efi-166692286106001
 -rw-------. 1 root root  1792 Oct 27 22:07 dmesg-efi-166692286107001
 -rw-------. 1 root root  1717 Oct 27 22:07 dmesg-efi-166692286108001
 -rw-------. 1 root root  1764 Oct 27 22:07 dmesg-efi-166692286109001
 -rw-------. 1 root root  1796 Oct 27 22:07 dmesg-efi-166692286110001
 -rw-------. 1 root root  1793 Oct 27 22:07 dmesg-efi-166692286111001
 -rw-------. 1 root root  1813 Oct 27 22:07 dmesg-efi-166692286112001
 -rw-------. 1 root root  1754 Oct 27 22:07 dmesg-efi-166692286113001
 -rw-------. 1 root root  1803 Oct 27 22:07 dmesg-efi-166692286114001
 -rw-------. 1 root root  1805 Oct 27 22:07 dmesg-efi-166692286115001
 -rw-------. 1 root root  1815 Oct 27 22:07 dmesg-efi-166692286116001
 -rw-r-----. 1 root root 28677 Nov 18 14:58 dmesg.txt

 1666922861/002:
 total 104
 drwxr-xr-x. 2 root root  4096 Nov 18 14:58 .
 drwxr-xr-x. 4 root root    28 Nov 18 14:58 ..
 -rw-------. 1 root root  1341 Oct 27 22:07 dmesg-efi-166692286101002
 -rw-------. 1 root root  1820 Oct 27 22:07 dmesg-efi-166692286102002
 -rw-------. 1 root root  1791 Oct 27 22:07 dmesg-efi-166692286103002
 -rw-------. 1 root root  1801 Oct 27 22:07 dmesg-efi-166692286104002
 -rw-------. 1 root root  1809 Oct 27 22:07 dmesg-efi-166692286105002
 -rw-------. 1 root root  1817 Oct 27 22:07 dmesg-efi-166692286106002
 -rw-------. 1 root root  1810 Oct 27 22:07 dmesg-efi-166692286107002
 -rw-------. 1 root root  1808 Oct 27 22:07 dmesg-efi-166692286108002
 -rw-------. 1 root root  1765 Oct 27 22:07 dmesg-efi-166692286109002
 -rw-------. 1 root root  1816 Oct 27 22:07 dmesg-efi-166692286110002
 -rw-------. 1 root root  1751 Oct 27 22:07 dmesg-efi-166692286111002
 -rw-------. 1 root root  1786 Oct 27 22:07 dmesg-efi-166692286112002
 -rw-------. 1 root root  1752 Oct 27 22:07 dmesg-efi-166692286113002
 -rw-------. 1 root root  1759 Oct 27 22:07 dmesg-efi-166692286114002
 -rw-------. 1 root root  1787 Oct 27 22:07 dmesg-efi-166692286115002
 -rw-------. 1 root root  1771 Oct 27 22:07 dmesg-efi-166692286116002
 -rw-------. 1 root root  1816 Oct 27 22:07 dmesg-efi-166692286117002
 -rw-r-----. 1 root root 30000 Nov 18 14:58 dmesg.txt

 1666922867:
 total 4
 drwxr-xr-x. 3 root root   17 Nov 18 14:58 .
 drwxr-xr-x. 7 root root  144 Nov 18 14:58 ..
 drwxr-xr-x. 2 root root 4096 Nov 18 14:58 003

 1666922867/003:
 total 104
 drwxr-xr-x. 2 root root  4096 Nov 18 14:58 .
 drwxr-xr-x. 3 root root    17 Nov 18 14:58 ..
 -rw-------. 1 root root  1388 Oct 27 22:07 dmesg-efi-166692286701003
 -rw-------. 1 root root  1824 Oct 27 22:07 dmesg-efi-166692286702003
 -rw-------. 1 root root  1795 Oct 27 22:07 dmesg-efi-166692286703003
 -rw-------. 1 root root  1805 Oct 27 22:07 dmesg-efi-166692286704003
 -rw-------. 1 root root  1813 Oct 27 22:07 dmesg-efi-166692286705003
 -rw-------. 1 root root  1821 Oct 27 22:07 dmesg-efi-166692286706003
 -rw-------. 1 root root  1814 Oct 27 22:07 dmesg-efi-166692286707003
 -rw-------. 1 root root  1812 Oct 27 22:07 dmesg-efi-166692286708003
 -rw-------. 1 root root  1769 Oct 27 22:07 dmesg-efi-166692286709003
 -rw-------. 1 root root  1820 Oct 27 22:07 dmesg-efi-166692286710003
 -rw-------. 1 root root  1755 Oct 27 22:07 dmesg-efi-166692286711003
 -rw-------. 1 root root  1790 Oct 27 22:07 dmesg-efi-166692286712003
 -rw-------. 1 root root  1756 Oct 27 22:07 dmesg-efi-166692286713003
 -rw-------. 1 root root  1763 Oct 27 22:07 dmesg-efi-166692286714003
 -rw-------. 1 root root  1791 Oct 27 22:07 dmesg-efi-166692286715003
 -rw-------. 1 root root  1775 Oct 27 22:07 dmesg-efi-166692286716003
 -rw-------. 1 root root  1820 Oct 27 22:07 dmesg-efi-166692286717003
 -rw-r-----. 1 root root 30111 Nov 18 14:58 dmesg.txt

Furthemore, pstore records on ERST are now able to accurately
identify the change in timestamp sequence in order to start a
new dmesg.txt, as needed.

18 months agoRevert "update credentials when reloading a service"
Lennart Poettering [Wed, 2 Nov 2022 15:02:33 +0000 (16:02 +0100)] 
Revert "update credentials when reloading a service"

This reverts commit 16a42b84cf88745e6b2b93f111f99179117b9610.

18 months agogpt-auto-generator: do not write "noauto" in unit options
Zbigniew Jędrzejewski-Szmek [Thu, 24 Nov 2022 12:45:11 +0000 (13:45 +0100)] 
gpt-auto-generator: do not write "noauto" in unit options

"auto"/"noauto" only make sense in the fstab. Putting them in Options= in the
generated unit has no effect and is confusing.

18 months agoMerge pull request #25618 from keszybz/sysctl-simplify-writing
Zbigniew Jędrzejewski-Szmek [Mon, 5 Dec 2022 07:41:00 +0000 (08:41 +0100)] 
Merge pull request #25618 from keszybz/sysctl-simplify-writing

Write sysctl values without newlines and as fixed strings

18 months agoimport: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd 25559/head
Ivan Shapovalov [Tue, 29 Nov 2022 12:20:48 +0000 (16:20 +0400)] 
import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd

Btrfs quotas are actually being enabled in systemd-importd via
setup_machine_directory(), not in systemd-{import,pull} where those
environment variables are checked. Therefore, also check them in
systemd-importd and avoid enabling quotas if requested by the user.

Fixes: #18421
Fixes: #15903
Fixes: #24387
18 months agomachine-pool: simplify return values from setup_machine_directory()
Ivan Shapovalov [Sat, 3 Dec 2022 16:31:36 +0000 (20:31 +0400)] 
machine-pool: simplify return values from setup_machine_directory()

Non-negative return values of setup_machine_directory() were never used
and never had clear meaning, so do not distinguish between various
non-error conditions and just return 0 in all cases.

18 months agorpm/systemd-update-helper: use --no-warn when disabling units 25437/head
Mike Yuan [Sat, 3 Dec 2022 12:27:47 +0000 (20:27 +0800)] 
rpm/systemd-update-helper: use --no-warn when disabling units

Suppress the "empty [Install] section" warning (see #25437).

18 months agosystemctl: allow suppress the warning of no install info using --no-warn
Mike Yuan [Sun, 27 Nov 2022 13:18:44 +0000 (21:18 +0800)] 
systemctl: allow suppress the warning of no install info using --no-warn

In cases like packaging scripts, it might be desired to use
enable/disable on units without install info. So, adding an
option '--no-warn' to suppress the warning.

18 months agosystemctl: warn if trying to disable a unit with no install info
Mike Yuan [Fri, 18 Nov 2022 07:43:34 +0000 (15:43 +0800)] 
systemctl: warn if trying to disable a unit with no install info

Trying to disable a unit with no install info is mostly useless, so
adding a warning like we do for enable (with the new dbus method
'DisableUnitFilesWithFlagsAndInstallInfo()'). Note that it would
still find and remove symlinks to the unit in /etc, regardless of
whether it has install info or not, just like before. And if there are
actually files to remove, we suppress the warning.

Fixes #17689

18 months agoUpdate TODO
Luca Boccassi [Sat, 3 Dec 2022 11:23:00 +0000 (11:23 +0000)] 
Update TODO

18 months agomanager: write net/unix/max_dgram_qlen sysctl as fixed string 25618/head
Zbigniew Jędrzejewski-Szmek [Sat, 3 Dec 2022 10:57:17 +0000 (11:57 +0100)] 
manager: write net/unix/max_dgram_qlen sysctl as fixed string

18 months agomanager: define a string constant for LONG_MAX and use that for sysctl
Zbigniew Jędrzejewski-Szmek [Sat, 3 Dec 2022 10:55:55 +0000 (11:55 +0100)] 
manager: define a string constant for LONG_MAX and use that for sysctl

This moves the formatting of the constant to compilation time and let's us
avoid asprintf() in the very hot path of initial boot.

18 months agomanager: do not append '\n' when writing sysctl settings
Zbigniew Jędrzejewski-Szmek [Sat, 3 Dec 2022 10:27:40 +0000 (11:27 +0100)] 
manager: do not append '\n' when writing sysctl settings

When booting with debug logs, we print:

   Setting '/proc/sys/fs/file-max' to '9223372036854775807
   '
   Setting '/proc/sys/fs/nr_open' to '2147483640
   '
   Couldn't write fs.nr_open as 2147483640, halving it.
   Setting '/proc/sys/fs/nr_open' to '1073741816
   '
   Successfully bumped fs.nr_open to 1073741816

The strange formatting is because we explicitly appended a newline in those two
places. It seems that the kernel doesn't care. In fact, we have a few dozen other
writes to sysctl where we don't append a newline. So let's just drop those here
too, to make the code a bit simpler and avoid strange output in the logs.

18 months agodissect: add new helper verity_settings_data_covers()
Lennart Poettering [Wed, 30 Nov 2022 17:44:06 +0000 (18:44 +0100)] 
dissect: add new helper verity_settings_data_covers()

This function checks if the external verity data referenced in
VeritySettings covers the specified partition (indicated via
designator).

Right now, we'll use that at one place, but in a later commit in more.

18 months agosystemctl: print a clear warning if people invoke systemctl without /proc/ 25616/head
Lennart Poettering [Fri, 2 Dec 2022 22:52:12 +0000 (23:52 +0100)] 
systemctl: print a clear warning if people invoke systemctl without /proc/

18 months agochase-symlink: when converting directory O_PATH fd to real fd, don't bother with...
Lennart Poettering [Fri, 2 Dec 2022 22:50:57 +0000 (23:50 +0100)] 
chase-symlink: when converting directory O_PATH fd to real fd, don't bother with /proc/

Replaces: #25581

18 months agoglyph-util: add warning sign special glyph
Lennart Poettering [Fri, 2 Dec 2022 22:50:48 +0000 (23:50 +0100)] 
glyph-util: add warning sign special glyph

18 months agodissect: pick up gpt partition flags
Lennart Poettering [Wed, 30 Nov 2022 17:55:05 +0000 (18:55 +0100)] 
dissect: pick up gpt partition flags

Let's store the GPT partition flags in the dissected partition info.

Right now we won't actually use them for anything yet, but later we'll
add that, when enforcing policy on dissection.

18 months agoMerge pull request #25570 from yuwata/dissect-rootless-image
Lennart Poettering [Fri, 2 Dec 2022 17:25:53 +0000 (18:25 +0100)] 
Merge pull request #25570 from yuwata/dissect-rootless-image

dissect: support to unmount image without root partition

18 months agoRevert "basic: add fallback in chase_symlinks_and_opendir() for cases when /proc...
Lennart Poettering [Fri, 2 Dec 2022 16:53:27 +0000 (17:53 +0100)] 
Revert "basic: add fallback in chase_symlinks_and_opendir() for cases when /proc is not mounted"

This reverts commit 3e22dfc2352bb5c4f058e23a82f424655b599b18.

18 months agobasic: add fallback in chase_symlinks_and_opendir() for cases when /proc is not mounted
Michal Sekletar [Wed, 30 Nov 2022 17:01:01 +0000 (18:01 +0100)] 
basic: add fallback in chase_symlinks_and_opendir() for cases when /proc is not mounted

https://bugzilla.redhat.com/show_bug.cgi?id=2136916

18 months agoMerge pull request #25541 from medhefgo/boot-reconnect
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2022 13:37:17 +0000 (14:37 +0100)] 
Merge pull request #25541 from medhefgo/boot-reconnect

boot: Fix huge boot delay

18 months agotest: check if we can use SHA1 MD for signing before using it
Frantisek Sumsal [Fri, 2 Dec 2022 11:48:26 +0000 (12:48 +0100)] 
test: check if we can use SHA1 MD for signing before using it

Some distributions have started phasing out SHA1, which breaks
the systemd-measure test case in its current form. Let's make sure we
can use SHA1 for signing beforehand to mitigate this.

Spotted on RHEL 9, where SHA1 signatures are disallowed by [0]:
```
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "/tmp/pcrsign-private.pem"
...
openssl rsa -pubout -in "/tmp/pcrsign-private.pem" -out "/tmp/pcrsign-public.pem"
writing RSA key
/usr/lib/systemd/systemd-measure sign --current --bank=sha1 --private-key="/tmp/pcrsign-private.pem" --public-key="/tmp/pcrsign-public.pem"
Failed to initialize signature context.
```

[0] https://gitlab.com/redhat/centos-stream/rpms/openssl/-/blob/c9s/0049-Selectively-disallow-SHA1-signatures.patch

18 months agoMerge pull request #25603 from DaanDeMeyer/mkosi
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2022 13:27:16 +0000 (14:27 +0100)] 
Merge pull request #25603 from DaanDeMeyer/mkosi

mkosi config changes

18 months agodissect-image: log expected UUID for /var
Yu Watanabe [Fri, 2 Dec 2022 05:42:52 +0000 (14:42 +0900)] 
dissect-image: log expected UUID for /var

Closes #25443.

18 months agobootspec: fix null-dereference-read
Yu Watanabe [Fri, 2 Dec 2022 05:30:22 +0000 (14:30 +0900)] 
bootspec: fix null-dereference-read

Fixes [oss-fuzz#53578](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53578).
Fixes #25450.

18 months agofuzz-systemctl: limit the size of input
Yu Watanabe [Fri, 2 Dec 2022 05:14:50 +0000 (14:14 +0900)] 
fuzz-systemctl: limit the size of input

Fixes [oss-fuzz#53552](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53552).
Fixes #25445.