]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
18 months agoci: Build Fedora rawhide with sanitizers in mkosi 33105/head
Daan De Meyer [Thu, 16 May 2024 15:20:24 +0000 (17:20 +0200)] 
ci: Build Fedora rawhide with sanitizers in mkosi

Let's make sure one build has sanitizers enabled for extra coverage.

18 months agoTEST-21-DFUZZER: Stop marking as slow
Daan De Meyer [Fri, 31 May 2024 15:15:47 +0000 (17:15 +0200)] 
TEST-21-DFUZZER: Stop marking as slow

This was a workaround to not run TEST-21-DFUZZER without sanitizers.
Now that we're going to get sanitizer support, let's run it by default
again.

18 months agoTEST-69-SHUTDOWN: Order after systemd-user-sessions.service
Daan De Meyer [Fri, 31 May 2024 15:01:27 +0000 (17:01 +0200)] 
TEST-69-SHUTDOWN: Order after systemd-user-sessions.service

Make sure that we're allowed to login by ordering ourselves after
systemd-user-sessions.service.

18 months agomkosi: Sanitizer improvements
Daan De Meyer [Thu, 16 May 2024 15:18:38 +0000 (17:18 +0200)] 
mkosi: Sanitizer improvements

- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.

18 months agomkosi: Add note about kernel command line limit
Daan De Meyer [Fri, 31 May 2024 15:26:01 +0000 (17:26 +0200)] 
mkosi: Add note about kernel command line limit

18 months agomkosi: Drop kernel command line to enable log context
Daan De Meyer [Fri, 31 May 2024 11:48:14 +0000 (13:48 +0200)] 
mkosi: Drop kernel command line to enable log context

The log context is already enabled by virtue of the log level being
set to debug, so no need to enable it explicitly.

18 months agocryptsetup-generator: Fix memory leak
Daan De Meyer [Fri, 31 May 2024 09:33:12 +0000 (11:33 +0200)] 
cryptsetup-generator: Fix memory leak

18 months agocore/unit: refuse to spawn units under frozen cgroup
Mike Yuan [Fri, 31 May 2024 04:41:31 +0000 (12:41 +0800)] 
core/unit: refuse to spawn units under frozen cgroup

Currently, Unit.freezer_state is always initialized to
FREEZER_RUNNING. While realizing cgroups for frozen units
was disabled in 7923e9493c48694b32d1a6de7b9a996c0194bf17,
the commit only checked for freezer_state of the unit inself,
meaning that newly-loaded units might be started and the kernel
would hang pid1 when trying to spawn sd-executor into sub-cgroup.
This can be easily reproduced by the following:

```console
# systemd-run --slice=test.slice sleep infinity
# systemctl freeze test.slice
# systemd-run --slice=test.slice sleep infinity
```

Therefore, let's correctly initialize Unit.freezer_state
based on the parent slice.

18 months agoMerge pull request #33123 from DaanDeMeyer/fix
Luca Boccassi [Fri, 31 May 2024 09:38:43 +0000 (11:38 +0200)] 
Merge pull request #33123 from DaanDeMeyer/fix

Two mkosi fixes

18 months agoMerge pull request #33122 from weblate/weblate-systemd-main
Luca Boccassi [Fri, 31 May 2024 08:44:43 +0000 (10:44 +0200)] 
Merge pull request #33122 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

18 months agomkosi: Unify device timeout for CI and local runs 33123/head
Daan De Meyer [Fri, 31 May 2024 08:25:08 +0000 (10:25 +0200)] 
mkosi: Unify device timeout for CI and local runs

Now that we use KVM and don't use repart anymore to create a root
partition on first boot, let's see if we can use the same device timeout
for both local and CI runs.

18 months agomkosi: Drop two unnecessary settings in CI config
Daan De Meyer [Fri, 31 May 2024 08:23:58 +0000 (10:23 +0200)] 
mkosi: Drop two unnecessary settings in CI config

We don't build erofs images anymore and the firmware to use is set
per test so no need to configure it the CI config.

18 months agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Fri, 31 May 2024 05:44:22 +0000 (05:44 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 3.0.0 to 3.2.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/9e55064634b67244f7deb4211452b4a7217b93de...d498805e5c7c0658e336948b3363480bcfd68da6)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
18 months agobuild(deps): bump redhat-plumbers-in-action/devel-freezer
dependabot[bot] [Fri, 31 May 2024 05:44:16 +0000 (05:44 +0000)] 
build(deps): bump redhat-plumbers-in-action/devel-freezer

Bumps [redhat-plumbers-in-action/devel-freezer](https://github.com/redhat-plumbers-in-action/devel-freezer) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/redhat-plumbers-in-action/devel-freezer/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/devel-freezer/compare/396c94ba8cb417474e6626c83a42addea210a403...ad766eafd555b28d2cb8e27937835983f9c3d173)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/devel-freezer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
18 months agobuild(deps): bump meson from 1.4.0 to 1.4.1 in /.github/workflows
dependabot[bot] [Fri, 31 May 2024 05:44:01 +0000 (05:44 +0000)] 
build(deps): bump meson from 1.4.0 to 1.4.1 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.4.0...1.4.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
18 months agopo: Translated using Weblate (Portuguese) 33122/head
Tiago Rocha Cunha [Fri, 31 May 2024 07:36:01 +0000 (09:36 +0200)] 
po: Translated using Weblate (Portuguese)

Currently translated at 100.0% (233 of 233 strings)

po: Translated using Weblate (Portuguese (Brazil))

Currently translated at 82.4% (192 of 233 strings)

Co-authored-by: Tiago Rocha Cunha <tiagocunha.me@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt/
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt_BR/
Translation: systemd/main

18 months agopo: Translated using Weblate (French)
Pierre GRASSER [Fri, 31 May 2024 07:36:01 +0000 (09:36 +0200)] 
po: Translated using Weblate (French)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Pierre GRASSER <pierre.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main

18 months agonetworkd-test: first wait for interface being configured
Yu Watanabe [Fri, 31 May 2024 01:56:30 +0000 (10:56 +0900)] 
networkd-test: first wait for interface being configured

DNS setting propagation to resolved may take some time.

18 months agogitignore: Ignore /pkg/ instead of pkg/ (#33119)
Daan De Meyer [Fri, 31 May 2024 06:06:07 +0000 (08:06 +0200)] 
gitignore: Ignore /pkg/ instead of pkg/ (#33119)

So we only match the top level directory and not subdirectories.

18 months agoAdd pkg/ to .gitignore folder
Daan De Meyer [Fri, 31 May 2024 05:58:35 +0000 (07:58 +0200)] 
Add pkg/ to .gitignore folder

Required now that the directories under pkg/ are not git submodules
anymore.

18 months agoMerge pull request #33106 from DaanDeMeyer/submodule
Daan De Meyer [Fri, 31 May 2024 05:43:20 +0000 (07:43 +0200)] 
Merge pull request #33106 from DaanDeMeyer/submodule

mkosi: Replace submodules with our own thing

18 months agoMerge pull request #33093 from YHNdnzj/freezer-util
Yu Watanabe [Fri, 31 May 2024 02:47:19 +0000 (11:47 +0900)] 
Merge pull request #33093 from YHNdnzj/freezer-util

bus-unit-util: rework UnitFreezer, explicitly thaw unit

18 months agobasic: Add BCACHEFS magic
Chris Packham [Thu, 30 May 2024 21:51:38 +0000 (09:51 +1200)] 
basic: Add BCACHEFS magic

Import magic.h from Linux 6.9 to get the definition of
BCACHEFS_SUPER_MAGIC. Update filesystems-gperf.gperf to add knowledge of
bcachefs.

This fixes the following error building against a bleeding edge kernel.
```
src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:

Filesystem found in kernel header but not in filesystems-gperf.gperf: BCACHEFS_SUPER_MAGIC
```

18 months agohwdb: Lenovo 16G6IRL volume keys and friends (#33107)
Victor Berchet [Fri, 31 May 2024 00:08:00 +0000 (02:08 +0200)] 
hwdb: Lenovo 16G6IRL volume keys and friends (#33107)

This prevents volume keys on the machine from repeating.
Full modalias:
```
$ cat /sys/class/dmi/id/modalias
dmi:bvnLENOVO:bvrMMCN36WW:bd03/26/2024:br1.36:efr1.30:svnLENOVO:pn21KH:pvrThinkBook16G6IRL:rvnLENOVO:rnLNVNB161216:rvrSDK0T76530WIN:cvnLENOVO:ct10:cvrThinkBook16G6IRL:skuLENOVO_MT_21KH_BU_idea_FM_ThinkBook16G6IRL:
```

18 months agohwdb: Add Logitech MX Master 3S Bluetooth ID
Maciej S. Szmigiero [Thu, 30 May 2024 22:05:32 +0000 (00:05 +0200)] 
hwdb: Add Logitech MX Master 3S Bluetooth ID

We already have an entry for this mouse when it is connected via USB Bolt
receiver, now add a Bluetooth LE connection entry too.

This mouse model supports both connection types, with up to 3 connection
slots (to different hosts) per single mouse.

18 months agomkosi: Override rpm's _fixperms script to be a noop 33106/head
Daan De Meyer [Thu, 30 May 2024 20:19:00 +0000 (22:19 +0200)] 
mkosi: Override rpm's _fixperms script to be a noop

Since rpm 4.20 it tries to fix the permissions of all source files
in the sources. This takes forever and fails in our case with a
permission error. Since we don't want rpm touching our source files,
override the script to be a noop.

18 months agomkosi: Disable add-determinism on Fedora
Daan De Meyer [Thu, 30 May 2024 20:17:29 +0000 (22:17 +0200)] 
mkosi: Disable add-determinism on Fedora

This was added for reproducible builds which we don't really care
about when building rpms in mkosi, so disable it from running as it's
broken and breaks our rpm builds.

18 months agomkosi: Skip debuginfo workaround on newer rpm
Daan De Meyer [Thu, 30 May 2024 20:16:13 +0000 (22:16 +0200)] 
mkosi: Skip debuginfo workaround on newer rpm

The corresponding bug was fixed in rpm 4.20 (of which the alpha is in
rawhide as rpm 4.19.91) so skip the workaround when we detect a newer
rpm version.

18 months agomkosi: Don't install wireguard-tools on Debian
Daan De Meyer [Thu, 30 May 2024 18:54:06 +0000 (20:54 +0200)] 
mkosi: Don't install wireguard-tools on Debian

Package was removed from testing. This can be reverted next week once
it's added back to testing.

18 months agomkosi: Replace submodules with our own thing
Daan De Meyer [Thu, 30 May 2024 14:24:42 +0000 (16:24 +0200)] 
mkosi: Replace submodules with our own thing

Unfortunately, git submodules break in all sorts of ways:

- Various github workflows (dependabot, github pages) try to do a shallow
clone of git submodules which does not work at all when the git repository
is hosted on pagure (https://pagure.io/pagure/issue/5453,
https://github.com/dependabot/dependabot-core/issues/9391).
- If the git forge hosting the git repository uses SHA256, then it breaks our
usage of it as a submodule as SHA256 repositories cannot be used as submodules
in SHA1 repositories (src.opensuse.org moved to SHA256 which broke our usage of
opensuse's systemd spec as a submodule).
- git submodules completely break usage of git worktrees.
- ...

Let's avoid all these issues by just doing our own home grown implementation of
git submodules. We lose the automatic dependabot updates this way but since dependabot
fails to run more often that not with submodules we don't really lose anything.

18 months agoMerge pull request #33081 from keszybz/networkctl-formatting
Luca Boccassi [Thu, 30 May 2024 14:33:38 +0000 (16:33 +0200)] 
Merge pull request #33081 from keszybz/networkctl-formatting

Fix formatting of speeds in networkctl

18 months agobus-unit-util: extend the bus call timeout for UnitFreezer 33093/head
Mike Yuan [Thu, 30 May 2024 07:09:28 +0000 (15:09 +0800)] 
bus-unit-util: extend the bus call timeout for UnitFreezer

Might fix #33083

There's another report available on Mastodon:
https://m.otter.homes/@kaixin/112510783502516607
https://m.otter.homes/@kaixin/112510803023469180

18 months agosleep,home: clean up logs for session freezer a bit
Mike Yuan [Thu, 30 May 2024 06:45:21 +0000 (14:45 +0800)] 
sleep,home: clean up logs for session freezer a bit

18 months agobus-unit-util: rework UnitFreezer, explicitly thaw unit
Mike Yuan [Thu, 30 May 2024 06:43:41 +0000 (14:43 +0800)] 
bus-unit-util: rework UnitFreezer, explicitly thaw unit

Currently, we don't explicitly call unit_freezer_thaw(),
but rely on the destructor to thaw the frozen unit on
return. This has several problems though, one of them
being that we ignore the return value of ThawUnit(),
which is something we really shouldn't do here,
since such failure can easily leave the whole system
in unusable state. Moreover, the logging is kinda messy,
e.g. homed might log "Everything completed" yet immediately
followed by "Failed to thaw unit". Instead, we should log
consistently and at higher level, to make things more
debuggable.

Therefore, let's step away from the practice. Plus,
make UnitFreezer object heap-allocated, to match
with existing unit_freezer_new() and allow us to
use NULL to denote that the freezer is disabled.

18 months agocore/dbus-unit: modernize bus_unit_method_freezer_generic a bit
Mike Yuan [Fri, 24 May 2024 14:53:49 +0000 (22:53 +0800)] 
core/dbus-unit: modernize bus_unit_method_freezer_generic a bit

18 months agocore/dbus-manager: only allow Freeze/ThawUnit() if loaded
Mike Yuan [Thu, 30 May 2024 12:44:58 +0000 (20:44 +0800)] 
core/dbus-manager: only allow Freeze/ThawUnit() if loaded

18 months agoMerge pull request #33101 from DaanDeMeyer/revert
Luca Boccassi [Thu, 30 May 2024 12:51:07 +0000 (14:51 +0200)] 
Merge pull request #33101 from DaanDeMeyer/revert

Revert accidentally merged commits

18 months agohomed: drop caches harder
Lennart Poettering [Thu, 30 May 2024 07:34:26 +0000 (09:34 +0200)] 
homed: drop caches harder

echoing "2" is apparently not enough to erase inodes/dentrys from
memory, hence use "3", which seems to work.

Fixes: #32596
18 months agoRevert "mkosi: Sanitizer improvements" 33101/head
Daan De Meyer [Thu, 30 May 2024 12:50:21 +0000 (14:50 +0200)] 
Revert "mkosi: Sanitizer improvements"

This reverts commit aef13ad0294b403993e19b424b26535fb65749f4.

18 months agoRevert "ci: Build with sanitizers in mkosi"
Daan De Meyer [Thu, 30 May 2024 12:50:10 +0000 (14:50 +0200)] 
Revert "ci: Build with sanitizers in mkosi"

This reverts commit 639403f9a86869984b155edda2521741950f5417.

18 months agoMerge pull request #32866 from DaanDeMeyer/sanitizers
Daan De Meyer [Thu, 30 May 2024 12:49:13 +0000 (14:49 +0200)] 
Merge pull request #32866 from DaanDeMeyer/sanitizers

mkosi: Sanitizers

18 months agomkosi: Preserve environment when running integration tests with sudo
Daan De Meyer [Thu, 30 May 2024 10:41:34 +0000 (12:41 +0200)] 
mkosi: Preserve environment when running integration tests with sudo

Otherwise we won't detect we're running in Github Actions and will
show the wrong command to fetch the journal.

18 months agoMerge pull request #33090 from poettering/tpm12-efi-check
Daan De Meyer [Thu, 30 May 2024 11:32:41 +0000 (13:32 +0200)] 
Merge pull request #33090 from poettering/tpm12-efi-check

efi-api: tighten check for TPM2 systems

18 months agohwdb: add a vmbus id for HyperV Video device
Lain "Fearyncess" Yang [Thu, 30 May 2024 05:51:40 +0000 (13:51 +0800)] 
hwdb: add a vmbus id for HyperV Video device

18 months agoMerge pull request #33084 from DaanDeMeyer/cgroup-log
Daan De Meyer [Thu, 30 May 2024 10:49:37 +0000 (12:49 +0200)] 
Merge pull request #33084 from DaanDeMeyer/cgroup-log

cgroup-util: Don't try to open pidfd for pids from cgroup.threads

18 months agoci: Build with sanitizers in mkosi 32866/head
Daan De Meyer [Thu, 16 May 2024 15:20:24 +0000 (17:20 +0200)] 
ci: Build with sanitizers in mkosi

18 months agomkosi: Sanitizer improvements
Daan De Meyer [Thu, 16 May 2024 15:18:38 +0000 (17:18 +0200)] 
mkosi: Sanitizer improvements

- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.

18 months agotest-network: Add dirs_exist_ok=True to cp_r() 33091/head
Daan De Meyer [Tue, 28 May 2024 11:08:23 +0000 (13:08 +0200)] 
test-network: Add dirs_exist_ok=True to cp_r()

Let's not fail if directories already exist in cp_r().

18 months agotest-execute: Load systemd-asan-env environment file if available
Daan De Meyer [Mon, 27 May 2024 11:34:40 +0000 (13:34 +0200)] 
test-execute: Load systemd-asan-env environment file if available

When DynamicUser= is enabled, we need LD_PRELOAD to be configured
correctly as the tests will load systemd's nss module which will complain
when built with sanitizers if the sanitizer libraries were not loaded
first.

18 months agotest-execute: Skip system call filter tests when sanitizers are used
Daan De Meyer [Mon, 27 May 2024 11:33:51 +0000 (13:33 +0200)] 
test-execute: Skip system call filter tests when sanitizers are used

System call filtering is incompatible with sanitizers so let's skip
these tests when we're built with sanitizers.

18 months agotest-execute: Skip test_exec_mount_apivfs() when running with sanitizers
Daan De Meyer [Thu, 30 May 2024 08:22:51 +0000 (10:22 +0200)] 
test-execute: Skip test_exec_mount_apivfs() when running with sanitizers

The test fails when running under sanitizers due to missing sanitizer
libraries. For now, let's skip the test until we can make the necessary
changes to run it under sanitizers.

18 months agoTEST-02-UNITTESTS: Pass asan environment to units if it is available
Daan De Meyer [Mon, 27 May 2024 17:40:35 +0000 (19:40 +0200)] 
TEST-02-UNITTESTS: Pass asan environment to units if it is available

Some tests (e.g. test-udev.py) might trigger one of our NSS modules
which means LD_PRELOAD has to be configured properly.

18 months agoTEST-79-MEMPRESS: Load systemd-asan-env if available
Daan De Meyer [Mon, 27 May 2024 11:38:51 +0000 (13:38 +0200)] 
TEST-79-MEMPRESS: Load systemd-asan-env if available

Required since we run with DynamicUser=1.

18 months agoTEST-36-NUMAPOLICY: Skip when running with sanitizers
Daan De Meyer [Mon, 27 May 2024 08:23:38 +0000 (10:23 +0200)] 
TEST-36-NUMAPOLICY: Skip when running with sanitizers

The test does not work under sanitizers as strace is used. Until the
test is fixed to not use strace let's skip it when running with
sanitizers.

18 months agoshared/format-table: print BPS with part after point 33081/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2024 16:09:48 +0000 (18:09 +0200)] 
shared/format-table: print BPS with part after point

Fixes https://github.com/systemd/systemd/issues/33076.
"2Gbps" → "2.5Gbps".

18 months agoshared/format-table: do not print '.0'
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2024 16:07:23 +0000 (18:07 +0200)] 
shared/format-table: do not print '.0'

This makes output a bit shorter and nicer. For us, shorter output is generally
better.

Also, drop unnecessary UINT64_C macros. The left operand is always uint64_t,
and C upcasting rules mean that it doesn't matter if the right operand is
narrower or signed, the operation is always done on the wider unsigned type.

18 months agoblockdev-util: update comment for blockdev_partscan_enabled
Mike Yuan [Thu, 30 May 2024 07:26:44 +0000 (15:26 +0800)] 
blockdev-util: update comment for blockdev_partscan_enabled

Follow-up for aa6fe772e1886cdf759954bc2a4742e818ec84c5

Also, the 'partscan' sysattr has been backported to v6.6.

18 months agocgroup-util: Don't try to open pidfd for pids from cgroup.threads 33084/head
Daan De Meyer [Wed, 29 May 2024 20:03:38 +0000 (22:03 +0200)] 
cgroup-util: Don't try to open pidfd for pids from cgroup.threads

Opening pidfds for non thread group leaders only works from 6.9 onwards with PIDFD_THREAD. On
older kernels or without PIDFD_THREAD pidfd_open() fails with EINVAL. Since we might read non
thread group leader IDs from cgroup.threads, we introduce and set CGROUP_NO_PIDFD to avoid
trying open pidfd's for them and instead use the pid as is.

18 months agoman: mention that IPMasquerade= and IPv6SendRA= implies IPv4Forwarding=/IPv6Forwarding=
Yu Watanabe [Thu, 30 May 2024 03:44:07 +0000 (12:44 +0900)] 
man: mention that IPMasquerade= and IPv6SendRA= implies IPv4Forwarding=/IPv6Forwarding=

It has been mentioned in IPv4Forwarding= and IPv6Forwarding=,
but let's also explain in the settings who imply these settings.

Follow-up for 3976c430927e1bfefa0413f80ebac84ab9a64350 and
485f5148b3a3e5ebc7e14acef78494a98435c4b9.

18 months agopcrlock: tweak error messages when we are not looking at a TPM2 event log 33090/head
Lennart Poettering [Thu, 30 May 2024 08:12:12 +0000 (10:12 +0200)] 
pcrlock: tweak error messages when we are not looking at a TPM2 event log

If we are looking at a TPM1.2 event log the first log record will not be
the "EfiSpecIdEvent" but something else. Let's improve the log messages
about this, and say explicitly that this is likely not a TPM2.0 event
log.

18 months agoefi-api: check /sys/class/tpm/tpm0/tpm_version_major, too
Lennart Poettering [Thu, 30 May 2024 08:02:36 +0000 (10:02 +0200)] 
efi-api: check /sys/class/tpm/tpm0/tpm_version_major, too

If the ceck for the ACPI TPM2 table did not work we currently check if
the EFI TPM table exists to check if the firmware supports TPM2.
Specifically we check if
/sys/kernel/security/tpm0/binary_bios_measurements exists. But that's
not enough, since that also exists on TPM1.2 systems. Hence, let's also
check /sys/class/tpm/tpm0/tpm_version_major which should exist under
similar conditions and tells us the kernel's idea of the TPM version in
use.

I originally intended to read the signature of the
/sys/kernel/security/tpm0/binary_bios_measurements contents for this,
but this is not ideal since that file has tight access mode, and our TPM
availability check would thus not work anymore if invoked unpriv.

Follow-up for 4b3391158197e9158cc754e56bbeaf94e2fd8395

Fixes: #33077
18 months agoTEST-02-UNITTESTS: Fix exit code checks
Daan De Meyer [Sun, 26 May 2024 16:22:54 +0000 (18:22 +0200)] 
TEST-02-UNITTESTS: Fix exit code checks

18 months agoTEST-05-RLIMITS: Bump memory limits
Daan De Meyer [Sun, 26 May 2024 14:28:21 +0000 (16:28 +0200)] 
TEST-05-RLIMITS: Bump memory limits

When running with sanitizers we need more memory otherwise the unit
gets OOM killed.

18 months agomkosi: Stop installing dbus-broker on OpenSUSE
Daan De Meyer [Tue, 28 May 2024 08:14:07 +0000 (10:14 +0200)] 
mkosi: Stop installing dbus-broker on OpenSUSE

dbus-broker and dbus-daemon have not been made interchangable on
OpenSUSE so we currently end up with dbus-broker used for the system
bus and dbus-daemon for the session bus. Let's stick to dbus-daemon
on OpenSUSE until they switch to dbus-broker.

18 months agomkosi: Install bpftrace
Daan De Meyer [Mon, 27 May 2024 17:22:11 +0000 (19:22 +0200)] 
mkosi: Install bpftrace

18 months agoMerge pull request #33079 from poettering/watchdog-no-disarm
Luca Boccassi [Wed, 29 May 2024 20:18:08 +0000 (22:18 +0200)] 
Merge pull request #33079 from poettering/watchdog-no-disarm

watchdog: don't disarm on shutdown

18 months agoMerge pull request #33072 from poettering/generator-fixes
Luca Boccassi [Wed, 29 May 2024 20:17:13 +0000 (22:17 +0200)] 
Merge pull request #33072 from poettering/generator-fixes

various fixes to generator execution

18 months agobasic: Add debug logging for pidref_set_pid()
Daan De Meyer [Wed, 29 May 2024 19:04:13 +0000 (21:04 +0200)] 
basic: Add debug logging for pidref_set_pid()

18 months agocgroup-util: Add debug logging for cg_kill_recursive()
Daan De Meyer [Wed, 29 May 2024 17:48:19 +0000 (19:48 +0200)] 
cgroup-util: Add debug logging for cg_kill_recursive()

18 months agomain: add comment explaining parameter to watchdog_close 33079/head
Lennart Poettering [Wed, 29 May 2024 15:41:42 +0000 (17:41 +0200)] 
main: add comment explaining parameter to watchdog_close

18 months agoshutdown: explicitly close watchdog with disarm=false before we destroy watchdog...
Lennart Poettering [Wed, 29 May 2024 15:40:28 +0000 (17:40 +0200)] 
shutdown: explicitly close watchdog with disarm=false before we destroy watchdog resources

Otherwise we'll close the device disarming it as side-effect of
watchdog_free_device(), which is not intended. Hence, let's close the fd
first explicitly leaving it armed.

Fixes: #33075
18 months agowatchdog: reset last ping timestamp when opening watchdog
Lennart Poettering [Wed, 29 May 2024 15:38:36 +0000 (17:38 +0200)] 
watchdog: reset last ping timestamp when opening watchdog

When we open a watchdog fresh we have never pinged it, hence reset the
ping timestamp explicitly, so that it is not only reset the first time
we open the device, but all times.

18 months agowatchdog: normalize how we name watchdog related calls
Lennart Poettering [Wed, 29 May 2024 15:37:58 +0000 (17:37 +0200)] 
watchdog: normalize how we name watchdog related calls

Let's put the "watchdog" always as prefix in the name, and not as suffix
or the middle. Just for reasons of naming hygiene

18 months agotest-format-table: add test for TABLE_BPS formatting
Zbigniew Jędrzejewski-Szmek [Wed, 29 May 2024 15:06:55 +0000 (17:06 +0200)] 
test-format-table: add test for TABLE_BPS formatting

18 months agoMerge pull request #33062 from DaanDeMeyer/virtio-scsi
Daan De Meyer [Wed, 29 May 2024 14:27:07 +0000 (16:27 +0200)] 
Merge pull request #33062 from DaanDeMeyer/virtio-scsi

mkosi: Switch back to cloud/KVM kernel packages

18 months agomkosi: Switch back to cloud/KVM kernel packages 33062/head
Daan De Meyer [Tue, 28 May 2024 12:09:57 +0000 (14:09 +0200)] 
mkosi: Switch back to cloud/KVM kernel packages

Now that we don't need megasas2 anymore, let's switch back to the
KVM/cloud kernel images to save on image size, build times and boot
times.

18 months agotest: Use virtio-scsi for keydev drive
Daan De Meyer [Wed, 29 May 2024 12:19:17 +0000 (14:19 +0200)] 
test: Use virtio-scsi for keydev drive

Otherwise qemu defaults to ide for which the module isn't always
available (e.g. it's missing in the debian linux cloud images).

18 months agoTEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller
Daan De Meyer [Tue, 28 May 2024 12:08:18 +0000 (14:08 +0200)] 
TEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller

The virtio-scsi driver is available in the KVM/cloud kernel
packages provided by distributions whereas the megasas2 driver is
not. Let's switch to virtio-scsi so we can switch back to the KVM/cloud
kernel packages.

18 months agoMerge pull request #33065 from DaanDeMeyer/nspawn
Daan De Meyer [Wed, 29 May 2024 13:23:48 +0000 (15:23 +0200)] 
Merge pull request #33065 from DaanDeMeyer/nspawn

test: Run tests that don't need a vm in systemd-nspawn

18 months agoexec-util: make sure to close all fds for invoked generators 33072/head
Lennart Poettering [Wed, 29 May 2024 09:50:54 +0000 (11:50 +0200)] 
exec-util: make sure to close all fds for invoked generators

We should really have set O_CLOEXEC for all our fds, but better be safe
than sorry.

18 months agoexec-util: use the stdio array of safe_fork_full() where appropriate
Lennart Poettering [Wed, 29 May 2024 09:46:51 +0000 (11:46 +0200)] 
exec-util: use the stdio array of safe_fork_full() where appropriate

18 months agomkosi: Run integration tests as root 33065/head
Daan De Meyer [Tue, 28 May 2024 13:56:47 +0000 (15:56 +0200)] 
mkosi: Run integration tests as root

This allows running integration tests that support it in nspawn
instead of qemu. This both gives extra coverage and speeds things up.

18 months agotest: Run tests that don't need a vm in systemd-nspawn
Daan De Meyer [Tue, 28 May 2024 13:54:35 +0000 (15:54 +0200)] 
test: Run tests that don't need a vm in systemd-nspawn

If we're not running the test as root, stick to using a virtual
machine, as mkosi can't do rootless nspawn yet.

18 months agomkosi: Disable iscsi service and socket
Daan De Meyer [Wed, 29 May 2024 10:33:57 +0000 (12:33 +0200)] 
mkosi: Disable iscsi service and socket

We'll always start these on demand in integration tests that need
them. No need to start them by default.

18 months agomkosi: Switch from btrfs to ext4
Daan De Meyer [Tue, 28 May 2024 21:15:25 +0000 (23:15 +0200)] 
mkosi: Switch from btrfs to ext4

Mounting multiple btrfs filesystems with the same fsid only works
properly from kernel 6.7 onwards. Let's switch to ext4 for now which
does support this.

18 months agomkosi: update to latest
Daan De Meyer [Tue, 28 May 2024 13:56:13 +0000 (15:56 +0200)] 
mkosi: update to latest

18 months agogenerator-setup: use RET_GATHER()
Lennart Poettering [Wed, 29 May 2024 09:45:50 +0000 (11:45 +0200)] 
generator-setup: use RET_GATHER()

18 months agomkosi: Set EXTRA_CFLAGS on opensuse
Daan De Meyer [Wed, 29 May 2024 08:50:16 +0000 (10:50 +0200)] 
mkosi: Set EXTRA_CFLAGS on opensuse

The opensuse spec doesn't unconditionally set FORTIFY_SOURCE=2 anymore
so let's drop our workaround.

18 months agoMerge pull request #32562 from Werkov/test-cgroup-opensuse
Daan De Meyer [Wed, 29 May 2024 09:01:00 +0000 (11:01 +0200)] 
Merge pull request #32562 from Werkov/test-cgroup-opensuse

Revert "TEST-19-CGROUP: Skip on opensuse"

18 months agobpf: add helper to translate kernel error codes from libbpf
Luca Boccassi [Tue, 28 May 2024 17:59:24 +0000 (18:59 +0100)] 
bpf: add helper to translate kernel error codes from libbpf

libbpf returns error codes from the kernel unmodified, and we don't understand
them so non-fatal ones are handled as hard errors.
Add a translation helper, and start by translating 524 to EOPNOTSUPP, which is
returned when nsresourced tries to use LSM BPF hooks that are not
implemented on a given arch (in this case, arm64 is misssing trampolines).

Fixes https://github.com/systemd/systemd/issues/32170

18 months agotest-network: update comment about status of kernel regression
Yu Watanabe [Wed, 29 May 2024 00:07:48 +0000 (09:07 +0900)] 
test-network: update comment about status of kernel regression

18 months agoMerge pull request #33066 from YHNdnzj/logind-linger
Luca Boccassi [Tue, 28 May 2024 20:41:57 +0000 (22:41 +0200)] 
Merge pull request #33066 from YHNdnzj/logind-linger

logind-user: check linger file in user_wants_service_manager too

18 months agotmpfiles: improve warning message and use O_NOCTTY
Christian Göttsche [Mon, 27 May 2024 13:38:18 +0000 (15:38 +0200)] 
tmpfiles: improve warning message and use O_NOCTTY

Mention in the warning message for a failed open on a to be removed file
why systemd-tmpfiles tried to open it.

Also open the file with the O_NOCTTY flag, since it should never become
the controlling terminal.

18 months agologind-user: check linger file in user_wants_service_manager too 33066/head
Mike Yuan [Tue, 28 May 2024 16:43:06 +0000 (00:43 +0800)] 
logind-user: check linger file in user_wants_service_manager too

Follow-up for 5099a50d4398e190387d204f5df81cc176bd33e2

Fixes #33005

18 months agologind-user: add missing assertion for user_check_linger_file
Mike Yuan [Tue, 28 May 2024 16:42:07 +0000 (00:42 +0800)] 
logind-user: add missing assertion for user_check_linger_file

Also make the function take const User*

18 months agotest-network: tun/tap fd may be owned by tentative worker processes
Yu Watanabe [Tue, 28 May 2024 09:15:02 +0000 (18:15 +0900)] 
test-network: tun/tap fd may be owned by tentative worker processes

PID1 may invoke a helper process, e.g. sd-close, during the test.
So, processes other than networkd and PID1 may be shown.
```
testtap99: tap pi multi_queue vnet_hdr persist filter
        Attached to processes:systemd-network(2852)(sd-close)(2863)systemd(1)
```

Closes #33055.

18 months agoMerge pull request #33057 from poettering/partscan-no-part
Luca Boccassi [Tue, 28 May 2024 14:39:15 +0000 (16:39 +0200)] 
Merge pull request #33057 from poettering/partscan-no-part

blockdev-util: for partition block devices partition scanning is always off

18 months agoman: capsule support was added in v256
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2024 13:58:36 +0000 (15:58 +0200)] 
man: capsule support was added in v256

The version info added directly to --capsule. If we add the
same switch in other places in the future, we will have to move
this.

Closes https://github.com/systemd/systemd/issues/33048.

18 months agoMerge pull request #33063 from keszybz/wiki-links
Luca Boccassi [Tue, 28 May 2024 14:21:45 +0000 (16:21 +0200)] 
Merge pull request #33063 from keszybz/wiki-links

Update wiki links

18 months agoMerge pull request #33008 from fbuihuu/optionally-link-ssh-dropins
Zbigniew Jędrzejewski-Szmek [Tue, 28 May 2024 14:02:40 +0000 (16:02 +0200)] 
Merge pull request #33008 from fbuihuu/optionally-link-ssh-dropins

Optionally link ssh dropins