]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agobuild(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.1
dependabot[bot] [Sat, 1 Feb 2025 09:54:20 +0000 (09:54 +0000)] 
build(deps): bump softprops/action-gh-release from 2.1.0 to 2.2.1

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/01570a1f39cb168c169c802c3bceb9e93fb10974...c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 30948201331e3c029c5557de23b57a37901c2eb4)

9 months agobuild(deps): bump coverallsapp/github-action from 2.3.4 to 2.3.6
dependabot[bot] [Sat, 1 Feb 2025 09:54:27 +0000 (09:54 +0000)] 
build(deps): bump coverallsapp/github-action from 2.3.4 to 2.3.6

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.3.4 to 2.3.6.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/cfd0633edbd2411b532b808ba7a8b5e04f76d2c8...648a8eb78e6d50909eff900e4ec85cab4524a45b)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit f82660222063c09522440efa3fa8e02c97dab1d5)

9 months agofirstboot: fix crash when hostname question is skipped
Zbigniew JÄ™drzejewski-Szmek [Thu, 30 Jan 2025 14:25:38 +0000 (15:25 +0100)] 
firstboot: fix crash when hostname question is skipped

(cherry picked from commit b66a4c157e9754528eec16c235265b4ce94d31e8)

9 months agoFix tense in SD_MESSAGE_SHUTDOWN_STR
Andrew Sayers [Wed, 29 Jan 2025 11:03:00 +0000 (11:03 +0000)] 
Fix tense in SD_MESSAGE_SHUTDOWN_STR

This is printed by bus_manager_log_shutdown() in logind-dbus.c,
near the start of the shutdown process.

Clarify that events *will* happen, long after this message is sent.

(cherry picked from commit 6c45c5a57cac1dd0c35a879bf46d4a42e03e74e1)

9 months agope: do not warn about .initrd addons
Luca Boccassi [Thu, 30 Jan 2025 01:51:05 +0000 (01:51 +0000)] 
pe: do not warn about .initrd addons

We now support them, so stop warning about them.

(cherry picked from commit f6928e6b5d59fd6b0dc34d338be1cd427c1d97d5)

9 months agoFix inversion of timesyncd_usec/epoch_usec variables in clock-warp.c
Devilish Spirits [Wed, 29 Jan 2025 20:54:27 +0000 (21:54 +0100)] 
Fix inversion of timesyncd_usec/epoch_usec variables in clock-warp.c

In clock_apply_epoch() function, the /usr/lib/clock-epoch timestamp was set to timesyncd_usec instead of epoch_usec and vice-versa which produced a misleading log message about the clock source systemd used for early clock sanitization. This trivial commit fix the mistake.

(cherry picked from commit 164295eb6dcc0271d7de030809732c23eeccf9f0)

9 months agomeson: generate keyboard-keys-list from local input.h
Alex Xu (Hello71) [Tue, 28 Jan 2025 22:17:01 +0000 (17:17 -0500)] 
meson: generate keyboard-keys-list from local input.h

otherwise it will use the system input.h which will fail to build if
newer than the bundled version

Fixes: 0a73c8e7b8 ("linux: import input.h and friends")
(cherry picked from commit bc996fd1ba7bce7be4cbae0d0d5ba7c35e8c3f50)

9 months agoukify: Fix two typing issues
Daan De Meyer [Wed, 29 Jan 2025 13:43:06 +0000 (14:43 +0100)] 
ukify: Fix two typing issues

(cherry picked from commit 2d6ae4319ccecdde7a87d12cb439a892afdec943)

9 months agoman: Update nss-myhostname.xml to reflect files
AndreFerreiraMsc [Tue, 28 Jan 2025 13:11:58 +0000 (14:11 +0100)] 
man: Update nss-myhostname.xml to reflect files

(cherry picked from commit 3e1d7b6aae5f5b24610620db810a5730dcc9a6a6)

9 months agotest: support slow test-ukify on Debian/Ubuntu
Luca Boccassi [Sun, 26 Jan 2025 17:35:06 +0000 (17:35 +0000)] 
test: support slow test-ukify on Debian/Ubuntu

Kernels are installed in /boot/ so find them there too

(cherry picked from commit 25a253084a16dcc077592ff85d62f69fa940d1de)

9 months agotest: use local stub if available in test-ukify
Luca Boccassi [Sun, 26 Jan 2025 19:50:22 +0000 (19:50 +0000)] 
test: use local stub if available in test-ukify

It might not be available on a CI system in the system
path, so use the local one if it was built

(cherry picked from commit bcca98c6326b2766d6b769661b15e292c12cf8ac)

9 months agotest: install stub package for test-ukify unit test
Luca Boccassi [Sun, 26 Jan 2025 20:06:36 +0000 (20:06 +0000)] 
test: install stub package for test-ukify unit test

(cherry picked from commit 78ce88e2656aedee8b38b36edcf1e074b90ff53a)

9 months agotest: cleanup after testcase_12_resolvectl2
Nick Rosbrook [Wed, 23 Oct 2024 20:31:00 +0000 (16:31 -0400)] 
test: cleanup after testcase_12_resolvectl2

(cherry picked from commit 266cfdfc77a0eee6d4df60d9795f381ced8a1e65)

9 months agocore: add trigger to path unit debug log
Luca Boccassi [Mon, 27 Jan 2025 20:30:16 +0000 (20:30 +0000)] 
core: add trigger to path unit debug log

Useful for debugging, given it's already logging and the trigger
is known, add it

(cherry picked from commit 6566b4306a65bc7af6ade0cb6887217212925202)

9 months agokbd-model-map: add a georgian mapping
Adam Williamson [Fri, 10 Jan 2025 21:01:47 +0000 (13:01 -0800)] 
kbd-model-map: add a georgian mapping

https://github.com/legionus/kbd/pull/127 adds a Georgian mapping
to kbd. console-setup already has one. Let's support it here, so
it's used for Georgian installs on distros that use this table.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
(cherry picked from commit f89d4c5f108ffbd29d0cc963ed7202bb9b0f778a)

9 months agomkosi: add loongarch64 to Debian's list of EFI arches
Luca Boccassi [Sat, 25 Jan 2025 01:21:30 +0000 (01:21 +0000)] 
mkosi: add loongarch64 to Debian's list of EFI arches

(cherry picked from commit 5ff144515e8b4d8faeb77461b9a62acb0ff1c0a5)

10 months agomkosi: Add VCS_TAG to PassEnvironment=
Daan De Meyer [Mon, 27 Jan 2025 10:27:49 +0000 (11:27 +0100)] 
mkosi: Add VCS_TAG to PassEnvironment=

(cherry picked from commit 28f96afbbbc023ff9397ff8767d1faa1512abbc1)

10 months agomkosi: Bump minimum version to 25
Daan De Meyer [Mon, 27 Jan 2025 10:26:29 +0000 (11:26 +0100)] 
mkosi: Bump minimum version to 25

Let's require everyone to be on the now officially released mkosi 25.

(cherry picked from commit e9fb163857223da6ea020b0bfd12581e9ea707ae)

10 months agomkosi: Update to latest
Daan De Meyer [Mon, 27 Jan 2025 10:26:13 +0000 (11:26 +0100)] 
mkosi: Update to latest

(cherry picked from commit b10a0a4ad69541a2cbae9df643c67c3292930a25)

10 months agorandom-util: fix compilation error
Yu Watanabe [Wed, 15 Jan 2025 16:29:04 +0000 (01:29 +0900)] 
random-util: fix compilation error

Fixes the following error:
```
../src/basic/random-util.c: In function "fallback_random_bytes":
../src/basic/random-util.c:45:26: error: initializer-string for array of "char" is too long [-Werror=unterminated-string-initialization]
   45 |                 .label = "systemd fallback random bytes v1",
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

(cherry picked from commit e722fe74ca5e00d3c8a5f85342b75c40ace051f9)

10 months agosystemctl: fix memleak
Yu Watanabe [Sun, 26 Jan 2025 19:17:27 +0000 (04:17 +0900)] 
systemctl: fix memleak

Fixes a bug introduced by adb6cd9be2b7e9e614d2b5835c7b70cf8eacc852.

Fixes #36178.

(cherry picked from commit 08570f284140752b9f0aad4dbcdff32c090a3661)

10 months agotools: add loongarch64 to debug-sd-boot script
Luca Boccassi [Sat, 25 Jan 2025 01:20:47 +0000 (01:20 +0000)] 
tools: add loongarch64 to debug-sd-boot script

(cherry picked from commit 829f57003d50634f28349f1ec6460421532ef318)

10 months agoukify: add riscv32 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:25:28 +0000 (01:25 +0000)] 
ukify: add riscv32 to --efi-arch

It is supported in the arch mapping at the top and in elf2efi, so add it here too

(cherry picked from commit d1429288ae4cf611ac3df6f604ddb4d6af480cf8)

10 months agoukify: add loongarch64 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:19:53 +0000 (01:19 +0000)] 
ukify: add loongarch64 to --efi-arch

(cherry picked from commit abe0033556e2416a04bb23dc6d739c6d4dd37001)

10 months agoman: fix reference to non-existing ukify parameter
Luca Boccassi [Fri, 24 Jan 2025 23:37:33 +0000 (23:37 +0000)] 
man: fix reference to non-existing ukify parameter

The --extend parameter was removed by https://github.com/systemd/systemd/pull/34608
and a --join-profile was added instead, fix leftover reference in manpage

Follow-up for 3891d57c4f768cb648e1a85483216eadae0b101e

(cherry picked from commit fd39606c258789d63a345feb6b492f6d2944d9a6)

10 months agoresolved: stop mdns/llmnr if no interface request it after bus method
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: stop mdns/llmnr if no interface request it after bus method

(cherry picked from commit 269da24c5a3713bea1f1650334e23ce09f6136b2)

10 months agoresolved: do not disable mdns/llmnr globally if it's enabled on any link
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: do not disable mdns/llmnr globally if it's enabled on any link

Fixes a regression caused by 2976730a4d34749bfb7a88da341464f1834ab1c6.

Fixes #36078.
Fixes #36126.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
(cherry picked from commit 962b757d9b62e42df2513577d717d730b619c80c)

10 months agomachine: revert type change of "leader" in io.systemd.Machine.Register method
Yu Watanabe [Fri, 24 Jan 2025 19:05:51 +0000 (04:05 +0900)] 
machine: revert type change of "leader" in io.systemd.Machine.Register method

The varlink method io.systemd.Machine.Register() is in v256, hence type
of "leader" cannot be changed.
Let's revert the change by 755cb018c9b3e93245afb86ec94223756ddd70e4, and
introduce another field "leaderProcessId", which takes detailed information
of the process.

Fixes a regression caused by 755cb018c9b3e93245afb86ec94223756ddd70e4.
Fixes #36155.

(cherry picked from commit 465865146657ad3b2a59f618e5e8a529b08561bd)

10 months agomount-util: make path_get_mount_info_at() also read utab
Yu Watanabe [Fri, 24 Jan 2025 17:35:21 +0000 (02:35 +0900)] 
mount-util: make path_get_mount_info_at() also read utab

As "_netdev" is only stored in utab.

Fixes a bug introduced by 5261c521e3a98932241f36e91cf6f7823c578aca.
Fixes #35949.

(cherry picked from commit 22f980dd0b04e65dbdc2fca9c653119459a2c52f)

10 months agocore/job: never consider reload jobs redundant
Mike Yuan [Wed, 22 Jan 2025 18:36:27 +0000 (19:36 +0100)] 
core/job: never consider reload jobs redundant

Follow-up for 656bbffc6c45bdd8d5c28a96ca948ba16c546547

The commit reworked job merging logic so that reload jobs
won't get merged. However, they might get dropped from
transaction due to being deemed redundant, i.e. way before
it even hits job_install(). Let's make sure reload jobs
are always kept during transaction construction stage, too.

(cherry picked from commit 7b940d8de91aeba6fa171eb42b690fa95641f29e)

10 months agovarlink: fix error name
Lennart Poettering [Tue, 21 Jan 2025 17:34:21 +0000 (18:34 +0100)] 
varlink: fix error name

The documentation and code agree on the same name, since always, but
when I put together the IDL I made a mistake and insert a "Not" that
wasn't supposed to be there.

Let's correct that.

(cherry picked from commit bd9553d6775a954704f0e37bf3b54b98212f4b0f)

10 months agoman: also fix documentation of start-limit-hit
Lennart Poettering [Tue, 14 Jan 2025 13:04:52 +0000 (14:04 +0100)] 
man: also fix documentation of start-limit-hit

(cherry picked from commit 390dffb862af5791a33abef08011f87818249975)

10 months agobus-wait-for-jobs: fix service result table
Lennart Poettering [Tue, 14 Jan 2025 12:56:58 +0000 (13:56 +0100)] 
bus-wait-for-jobs: fix service result table

We were missing one service result (oom-kill), and the ratelimit one is
called differently. Correct that so that we generate proper log messages
for these cases.

(cherry picked from commit a7620f5dd16f0386b8ddeadfcd4e89da4050beef)

10 months agostub: drop PE sections parsing cap
Luca Boccassi [Fri, 10 Jan 2025 21:02:55 +0000 (21:02 +0000)] 
stub: drop PE sections parsing cap

This was added originally as it was thought that Windows applied
the same cap. Nowadays the specs do not mention it, and it is
believed Windows no longer applies it either, so drop it in order
to allow an arbitrary number of DTBs to be included

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

(cherry picked from commit 8c5b359579b0f1029edafb0bd96b5ebfb271db76)

10 months agoprocess-util: do not unblock unrelated signals while forking
Lennart Poettering [Thu, 9 Jan 2025 10:15:49 +0000 (11:15 +0100)] 
process-util: do not unblock unrelated signals while forking

This makes sure when we are blocking signals in preparation for fork()
we'll not temporarily unblock any signals previously set, by mistake.

It's safe for us to block more, but not to unblock signals already
blocked. Fix that.

Fixes: #35470
(cherry picked from commit 78933625084b11c495c073fc7c34067315a1da50)

10 months agotest: add test cases for parsing SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=
Yu Watanabe [Mon, 6 Jan 2025 10:16:23 +0000 (19:16 +0900)] 
test: add test cases for parsing SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=

(cherry picked from commit 4c9da4dc91c6f875683a6c9fc00df19686f242cc)

10 months agocore/device: do not drop backslashes in SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=
Yu Watanabe [Mon, 6 Jan 2025 08:26:52 +0000 (17:26 +0900)] 
core/device: do not drop backslashes in SYSTEMD_WANTS=/SYSTEMD_USER_WANTS=

Let consider the following udev rules:
===
PROGRAM="/usr/bin/systemd-escape foo-bar-baz", ENV{SYSTEMD_WANTS}+="test1@$result.service"
PROGRAM="/usr/bin/systemd-escape aaa-bbb-ccc", ENV{SYSTEMD_WANTS}+="test2@$result.service"
===
Then, a device expectedly gains a property:
===
SYSTEMD_WANTS=test1@foo\x2dbar\x2dbaz.service test2@aaa\x2dbbb\x2dccc.service
===
After the event being processed by udevd, PID1 processes the device, the
property previously was parsed with extract_first_word(EXTRACT_UNQUOTE),
then the device unit gained the following dependencies:
===
Wants=test1@foox2dbarx2dbaz.service test2@aaax2dbbbx2dccc.service
===
So both '%i' and '%I' for the template services did not match with the original
data, and it was hard to use systemd-escape in PROGRAM= udev rule token.

This makes the property parsed with extract_first_word(EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE),
hence the device unit now gains the following dependencies:
===
Wants=test1@foo\x2dbar\x2dbaz.service test2@aaa\x2dbbb\x2dccc.service
===
and '%I' for the template services match with the original data.

Fixes a bug caused by ceed8f0c8b9a46300eccd1afa2dd8d3c2cb6b47c (v233).

Fixes #16735.
Replaces #16737 and #35768.

(cherry picked from commit a467358b2a18b611e48e62ed89167a04e0f7634e)

10 months agoefivars: deal with uncommitted efi variables
wrvsrx [Sat, 7 Dec 2024 02:32:15 +0000 (10:32 +0800)] 
efivars: deal with uncommitted efi variables

Unfortunately kernel reports EOF if there's an inconsistency between efivarfs var list
and what's actually stored in firmware, c.f. #34304. A zero size env var is not allowed in
efi and hence the variable doesn't really exist in the backing store as long as it is zero
sized, and the kernel calls this "uncommitted". Hence we translate EOF back to ENOENT here,
as with kernel behavior before
https://github.com/torvalds/linux/commit/3fab70c165795431f00ddf9be8b84ddd07bd1f8f

If the kernel changes behaviour (to flush dentries on resume), we can drop
this at some point in the future. But note that the commit is 11
years old at this point so we'll need to deal with the current behaviour for
a long time.

Fix #34304.

(cherry picked from commit 6013dee98d6543ac290a2938c4ec8494e26531ab)

10 months agoboot: Improve log message
Daan De Meyer [Sat, 25 Jan 2025 19:42:54 +0000 (20:42 +0100)] 
boot: Improve log message

(cherry picked from commit ff83795469a20af02a9bf3285992128799b16302)

10 months agoHACKING: Drop run0 from mkosi boot invocation
Daan De Meyer [Fri, 24 Jan 2025 16:29:58 +0000 (17:29 +0100)] 
HACKING: Drop run0 from mkosi boot invocation

mkosi will itself use run0 or sudo when not running as root to invoke
systemd-nspawn, so no need to do it in HACKING.md.

(cherry picked from commit 1743f0370fd89d95a2fa89e8475f4b82a38f54c3)

10 months agodocs/HACKING: use 'run0' to indicate which commands require privileges
Zbigniew JÄ™drzejewski-Szmek [Mon, 9 Dec 2024 19:24:34 +0000 (20:24 +0100)] 
docs/HACKING: use 'run0' to indicate which commands require privileges

(cherry picked from commit 6ed73883c68304f6677ff342f457aad3c18ab6c6)

10 months agoHACKING: Move OBS section further down
Daan De Meyer [Fri, 24 Jan 2025 16:28:15 +0000 (17:28 +0100)] 
HACKING: Move OBS section further down

HACKING.md should first and foremost tell someone how to hack on
systemd, installing packages from OBS isn't the most likely section
a new contributor will be interested in, so let's move it further
down.

(cherry picked from commit 798b9fb7eb71ad127af49f5308f9e95de4e77fa8)

10 months agomkosi: Drop usage of _systemd_QUIET in arch build script
Daan De Meyer [Fri, 24 Jan 2025 09:54:51 +0000 (10:54 +0100)] 
mkosi: Drop usage of _systemd_QUIET in arch build script

We dropped the variable in the packaging specs for Arch to keep the
integration points as minimal as possible so let's stop using it in
the build script as well.

(cherry picked from commit 8dab59e610720c022f962311069c95fd8569f82a)

10 months agomkosi: Add back --preserve-env when running integrationt tests
Daan De Meyer [Thu, 23 Jan 2025 09:35:06 +0000 (10:35 +0100)] 
mkosi: Add back --preserve-env when running integrationt tests

The test wrapper script depends on various github actions environment
variables so let's make sure those are propagated.

(cherry picked from commit 6733b07d43f3524b66b5ab79a96cad192d2280fc)

10 months agomkosi: Update to latest
Daan De Meyer [Wed, 22 Jan 2025 14:58:13 +0000 (15:58 +0100)] 
mkosi: Update to latest

With the latest mkosi, mkosi takes care of making sure it is
available within mkosi sandbox so we get rid of all the --preserve-env=
options when we invoke mkosi sandbox with sudo as these are not
required anymore. It also doesn't matter anymore if mkosi is installed
in /usr on the host so we get rid of the documentation around that as
well.

(cherry picked from commit 94558e6fc70b53bfa36707afd7e90ff1737194cf)

10 months agomkosi: Run two more mkosi commands with sudo
Daan De Meyer [Wed, 22 Jan 2025 21:24:36 +0000 (22:24 +0100)] 
mkosi: Run two more mkosi commands with sudo

Running some mkosi commands as root and other not can lead to cache
invalidations with the latest version, so make sure we run everything
as root after we've built the tools tree.

(cherry picked from commit 007d255d870bee37db03da1875c0387598bdedde)

10 months agotest: Make sure we run lcov from the meson source directory
Daan De Meyer [Wed, 22 Jan 2025 13:55:45 +0000 (14:55 +0100)] 
test: Make sure we run lcov from the meson source directory

In ac75c5192797082c1965ab30be4711490f2937bc, we accidentally changed
the working directory that the tools executed in the wrapper script
are invoked in. This broke our invocations of lcov. Let's explicitly
run those in the meson source directory again to fix the coverage
workflow.

(cherry picked from commit d3d501e94930c3865f13c881a23980941cce079f)

10 months agoTEST-74-AUX-UTILS: Move run0 pcrlock test to TEST-70-TPM
Daan De Meyer [Tue, 21 Jan 2025 12:48:13 +0000 (13:48 +0100)] 
TEST-74-AUX-UTILS: Move run0 pcrlock test to TEST-70-TPM

On CentOS Stream 9/10 booting mkosi qemu with --firmware=linux doesn't
add the virtual TPM to the virtual machine which means TEST-74-AUX-UTILS.run.sh
fails because it requires a TPM.

Let's move the systemd-pcrlock logic that requires a TPM to
TEST-70-TPM.pcrlock to avoid the problem.

(cherry picked from commit c0165676e9b95996a402b26c45023d9358ba159d)

10 months agotest: Look for qemu in /usr/libexec/qemu-kvm as well
Daan De Meyer [Tue, 21 Jan 2025 11:29:56 +0000 (12:29 +0100)] 
test: Look for qemu in /usr/libexec/qemu-kvm as well

On CentOS Stream, the qemu binary is /usr/libexec/qemu-kvm so use
that if it's available.

(cherry picked from commit 34da8dd345935d461a62db5787cfbc35e8be2b4b)

10 months agomkosi: Run more commands as root
Daan De Meyer [Mon, 20 Jan 2025 12:57:02 +0000 (13:57 +0100)] 
mkosi: Run more commands as root

zypper has some new rather questionable userspace level permission
checking that blows ups completely when operating as root on an
cache directory owned by a non-root user, so let's build the tools
tree and set up meson as root to avoid the issue.

(https://github.com/openSUSE/libzypp/issues/603)

Also drop a leftover debug message from coverage.yml while we're at
it.

(cherry picked from commit cb13d6b44f7952fdfd1fbab99293403a107c75c0)

10 months agomkosi: Don't set -O ^orphan_file in centos stream 9 tools tree
Daan De Meyer [Fri, 17 Jan 2025 15:39:09 +0000 (16:39 +0100)] 
mkosi: Don't set -O ^orphan_file in centos stream 9 tools tree

(cherry picked from commit 26025dba3ec967e4897338c838d21d06240a99c0)

10 months agomkosi: lcov and shellcheck are not in EPEL 10
Daan De Meyer [Fri, 17 Jan 2025 14:35:37 +0000 (15:35 +0100)] 
mkosi: lcov and shellcheck are not in EPEL 10

Let's drop these from CentOS Stream tools trees as they are not in
EPEL 10 yet.

(cherry picked from commit 7a75a6f70f037d3403c5f2c13ecc2b814fc26867)

10 months agomkosi: Use a bigger variety of tools tree distributions
Daan De Meyer [Fri, 17 Jan 2025 12:28:47 +0000 (13:28 +0100)] 
mkosi: Use a bigger variety of tools tree distributions

Let's add more coverage for building with tools trees by building
each image with a tools tree of the same distribution and release.

Because not every tools tree distribution has a newer meson yet, we
only use --max-lines= when meson actually knows the option.

(cherry picked from commit 7645139bd7c7ccd10849c43644286e4877719a45)

10 months agomkosi: Update to latest
Daan De Meyer [Fri, 17 Jan 2025 14:12:46 +0000 (15:12 +0100)] 
mkosi: Update to latest

(cherry picked from commit 685666afd824a28c38ae7ee68c8891b03cb122de)

10 months agomkosi: Don't set ToolsTreeRepositories= for CentOS Stream tools
Daan De Meyer [Fri, 17 Jan 2025 14:29:14 +0000 (15:29 +0100)] 
mkosi: Don't set ToolsTreeRepositories= for CentOS Stream tools

mkosi does this itself so no need to do it in systemd.

(cherry picked from commit 8fa4a292a64c71a05869f495fab77f2d2bd08894)

10 months agosbsign: Make sure output file mode respects umask
Daan De Meyer [Sun, 19 Jan 2025 21:48:21 +0000 (22:48 +0100)] 
sbsign: Make sure output file mode respects umask

(cherry picked from commit 6f594acd632f61fde4b1c33bfcab3954ec304e8a)

10 months agosbsign: Make two debug logs into error logs
Daan De Meyer [Mon, 20 Jan 2025 08:01:37 +0000 (09:01 +0100)] 
sbsign: Make two debug logs into error logs

(cherry picked from commit 7180a3b38ca4c167ab2df12bec02058878f8142c)

10 months agoci: Stop archiving packages
Daan De Meyer [Wed, 15 Jan 2025 11:58:36 +0000 (12:58 +0100)] 
ci: Stop archiving packages

This takes up a lot of storage space and we're almost hitting the
limit so since nobody's actually using these and we just started
doing nightly builds in OBS, let's drop this and point people towards
OBS for nightly packages in the future.

(cherry picked from commit e9b9fc080f0616d08269c7e5946d2f389dff83ec)

10 months agotest: Drop sandbox() from integration test wrapper
Daan De Meyer [Wed, 15 Jan 2025 09:21:33 +0000 (10:21 +0100)] 
test: Drop sandbox() from integration test wrapper

With the latest changes, this is not required anymore as mkosi sandbox
will set up the proper $PATH to make sure the executables from the build
directory are used.

(cherry picked from commit ac75c5192797082c1965ab30be4711490f2937bc)

10 months agomkosi: Update to latest
Daan De Meyer [Wed, 15 Jan 2025 09:21:12 +0000 (10:21 +0100)] 
mkosi: Update to latest

(cherry picked from commit 82d6bcbdea7125d4e8d6acaa60e9847a7ce1464d)

10 months agoman: Clarify systemd-notify and sd_notify() PID documentation
Daan De Meyer [Tue, 14 Jan 2025 15:05:33 +0000 (16:05 +0100)] 
man: Clarify systemd-notify and sd_notify() PID documentation

Let's clarify more explicitly that privileged calls to
systemd-notify --pid= and sd_pid_notify() effectively override any
configured NotifyAccess=main|exec for a service.

(cherry picked from commit bbe9e03f8066d1001497494ee862cf45f986b854)

10 months agomkosi: Install libxslt on CentOS/Fedora instead of xsltproc
Daan De Meyer [Tue, 14 Jan 2025 12:53:26 +0000 (13:53 +0100)] 
mkosi: Install libxslt on CentOS/Fedora instead of xsltproc

Same package, but xsltproc is a very recently introduced Provides
for libxslt, and isn't available on CentOS Stream 9, so let's install
the package directly instead.

(cherry picked from commit 05932f4768bc329f933774eef9a2286f706d3673)

10 months agofmf: Only move logs if corresponding directory exists
Daan De Meyer [Tue, 14 Jan 2025 10:41:17 +0000 (11:41 +0100)] 
fmf: Only move logs if corresponding directory exists

Otherwise find fails with an error.

(cherry picked from commit 3c2fa8e0501f9f39b3b7ca0506a7d548a39af928)

10 months agotest: Only move journal file if we didn't just unlink it
Daan De Meyer [Tue, 14 Jan 2025 08:52:40 +0000 (09:52 +0100)] 
test: Only move journal file if we didn't just unlink it

(cherry picked from commit 1d77ac19cfa1c9b194d7e9805430ab6fd38ba97e)

10 months agotest: Fix bug in integration test wrapper
Daan De Meyer [Mon, 13 Jan 2025 09:33:20 +0000 (10:33 +0100)] 
test: Fix bug in integration test wrapper

(cherry picked from commit 79ac78e3680a425d86c7a90e6846c630c9583b48)

10 months agofmf: Skip TEST-21-DFUZZER
Daan De Meyer [Fri, 10 Jan 2025 14:29:28 +0000 (15:29 +0100)] 
fmf: Skip TEST-21-DFUZZER

Similar to Github Actions, since we don't build with sanitizers in
the packit job, let's skip TEST-21-DFUZZER.

(cherry picked from commit e0c2fd6a3345d26afdf4159406c38cd9101d2e0d)

10 months agofmf: Use different heuristic on beefy systems
Daan De Meyer [Fri, 10 Jan 2025 14:26:54 +0000 (15:26 +0100)] 
fmf: Use different heuristic on beefy systems

If we save journals in /tmp, we can run a larger number of tests in
parallel so let's make use of the larger number of CPUs if the tests
run on a beefy machine.

(cherry picked from commit 53546c71fe0a1b30ee296df84bb8c3577f5675a4)

10 months agofmf: Bump inotify limits to avoid systemd-nspawn failures
Daan De Meyer [Fri, 10 Jan 2025 14:26:37 +0000 (15:26 +0100)] 
fmf: Bump inotify limits to avoid systemd-nspawn failures

(cherry picked from commit c32a8cdaa0f03ae29e9edade1213cc2001b28000)

10 months agotest: Move StateDirectory= directive into dropin
Daan De Meyer [Fri, 10 Jan 2025 13:51:24 +0000 (14:51 +0100)] 
test: Move StateDirectory= directive into dropin

The integration-test-setup calls require StateDirectory= but some
tests override the test unit used which then won't have StateDirectory=
so let's move StateDirectory= into the dropin as well to avoid this
issue.

(cherry picked from commit 1f17ec0ed419627a686ee6e719ac7f55cf082ada)

10 months agotest: Don't register machines with machined unless we're in interactive mode
Daan De Meyer [Fri, 10 Jan 2025 13:29:58 +0000 (14:29 +0100)] 
test: Don't register machines with machined unless we're in interactive mode

(cherry picked from commit 84b30442d257102a9a39122f9a537fa48fb0bfda)

10 months agotest: Add option to save in progress test journals to /tmp
Daan De Meyer [Fri, 10 Jan 2025 13:27:33 +0000 (14:27 +0100)] 
test: Add option to save in progress test journals to /tmp

The journal isn't the best at being fast, especially when writing
to disk and not to memory, which can cause integration tests to
grind to a halt on beefy systems due to all the systemd-journal-remote
instances not being able to write journal entries to disk fast enough.

Let's introduce an option to allow writing in progress test journals
to use /tmp which can be used on beefy systems with lots of memory to
speed things up.

(cherry picked from commit e49fdecd161b3d391e55311652fda3220d851fa1)

10 months agotree-wide: Fix python formatting
Daan De Meyer [Thu, 9 Jan 2025 15:24:22 +0000 (16:24 +0100)] 
tree-wide: Fix python formatting

The new release of ruff formats a few more things which causes linter
failures in CI so let's fix those formatting nits.

(cherry picked from commit 96403d5121d93dd47dbe9dab5b90ff973e664ac3)

10 months agofmf: Log clock source
Daan De Meyer [Thu, 9 Jan 2025 14:24:51 +0000 (15:24 +0100)] 
fmf: Log clock source

(cherry picked from commit 6e761c5a93278fc719a66f7c984af9608b836991)

10 months agofmf: Move meson logs and failed test journals to test artifacts dir
Daan De Meyer [Thu, 9 Jan 2025 14:13:18 +0000 (15:13 +0100)] 
fmf: Move meson logs and failed test journals to test artifacts dir

(cherry picked from commit 0e444c948e7d8ddbdec83116b68af7d876e2d2f6)

10 months agomkosi: Re-enable TEST-21-DFUZZER when running with sanitizers
Daan De Meyer [Tue, 7 Jan 2025 14:01:02 +0000 (15:01 +0100)] 
mkosi: Re-enable TEST-21-DFUZZER when running with sanitizers

Similar to how CentOS CI did it previously, let's only run
TEST-21-DFUZZER when built with sanitizers for maximum effect.

(cherry picked from commit 103e92810a4bd3f01d2a49d85ef9575d60a8d244)

10 months agotest: Only plug in integration-test-setup.sh in interactive mode
Daan De Meyer [Thu, 9 Jan 2025 10:28:15 +0000 (11:28 +0100)] 
test: Only plug in integration-test-setup.sh in interactive mode

If we're not running interactively, there's no point in the features
from integration-test-setup.sh which are intended for interactive
development and debugging so lets skip adding it in that case.

(cherry picked from commit 794d456cf402a35290d6562c21f0ff846511026c)

10 months agotest: Drop set -x from integration-test-setup.sh
Daan De Meyer [Thu, 9 Jan 2025 10:27:51 +0000 (11:27 +0100)] 
test: Drop set -x from integration-test-setup.sh

(cherry picked from commit 90538ede55ac9d40dc513f64f052c687672cae89)

10 months agofmf: Force SELinux relabel when running within testing farm
Daan De Meyer [Wed, 8 Jan 2025 15:03:06 +0000 (16:03 +0100)] 
fmf: Force SELinux relabel when running within testing farm

We expect to run as root within testing farm and to have permissions
to do selinux relabelling so let's enable it explicitly.

(cherry picked from commit e1c883bf32f3922bfc977701062e353c0a0a4ac5)

10 months agoTEST-06-SELINUX: Add knob to allow checking for AVCs
Daan De Meyer [Wed, 8 Jan 2025 12:31:11 +0000 (13:31 +0100)] 
TEST-06-SELINUX: Add knob to allow checking for AVCs

When running the integration tests downstream, it's useful to be
able to test that a new systemd version doesn't introduce any AVC
denials, so let's add a knob to make that possible.

(cherry picked from commit de19520ec979902fd457515d1a795210fdaedf93)

10 months agofmf: Dump CPU and memory information
Daan De Meyer [Wed, 8 Jan 2025 15:41:46 +0000 (16:41 +0100)] 
fmf: Dump CPU and memory information

(cherry picked from commit 44368f84d7ddbec7a50648a65c27cb6a31090a29)

10 months agofmf: Only mess with /etc/yum.repos.d when running within testing farm
Daan De Meyer [Wed, 8 Jan 2025 11:12:15 +0000 (12:12 +0100)] 
fmf: Only mess with /etc/yum.repos.d when running within testing farm

If running tmt locally to debug the test script, make sure we don't
mess with /etc/yum.repos.d.

(cherry picked from commit 8e3347f3bd3d9a01b8f39b0858eab74084ecf20a)

10 months agofmf: Fix glob
Daan De Meyer [Wed, 8 Jan 2025 09:38:21 +0000 (10:38 +0100)] 
fmf: Fix glob

Globs inside quotes aren't expanded and we need the glob to be more
specific to avoid matching multiple entries inside the tmt source
directory.

(cherry picked from commit fc1b08dee2ccf706580fa448e66831d1e853d054)

10 months agofmf: Fix dist-git example
Daan De Meyer [Wed, 8 Jan 2025 09:25:50 +0000 (10:25 +0100)] 
fmf: Fix dist-git example

All that's needed is dist-git-source: true so remove the other settings
that aren't required.

(cherry picked from commit 0a85b3757968a2750286119760244e017c990263)

10 months agofmf: Don't fail if we can't put selinux in permissive mode
Daan De Meyer [Wed, 8 Jan 2025 09:25:05 +0000 (10:25 +0100)] 
fmf: Don't fail if we can't put selinux in permissive mode

The tests might be running unprivileged or in an environment without
selinux so let's not fail if we can't put it in permissive mode.

(cherry picked from commit 0250db0139b159cb9e6c1a87ad91ffdd03e80236)

10 months agomeson: bump version to 257.2 v257.2
Luca Boccassi [Tue, 7 Jan 2025 20:45:53 +0000 (20:45 +0000)] 
meson: bump version to 257.2

10 months agojournalctl: make --invocation and --list-invocations accept unit name without suffix
Yu Watanabe [Wed, 11 Dec 2024 00:05:34 +0000 (09:05 +0900)] 
journalctl: make --invocation and --list-invocations accept unit name without suffix

Fixes #35538.

(cherry picked from commit e8823b5e352711c68ab3282697a6ab1cfb06d25a)

10 months agosystemctl: certainly ignore ENOENT in checking inhibitors
Yu Watanabe [Thu, 2 Jan 2025 12:15:02 +0000 (21:15 +0900)] 
systemctl: certainly ignore ENOENT in checking inhibitors

Fixes a bug caused by 804874d26ac73e0af07c4c5d7165c95372f03f6d.

Follow-up for 084f361b509cbffe7ffd5ab6085469f76f799fe5 and
a1417e5563acb73a0accdc12b3af91e4ec1c7f46.

Note, ERRNO_IS_NEG_DISCONNECT() includes ENONET rather than ENOENT...
So, ENOENT needs to be handled explicitly.

Fixes #35757 and #35806.

(cherry picked from commit 66f379b63ddac8c72b9130df86a82b68ec42c119)

10 months agosystemctl: also ignore ENOENT in checking inhibitors
Yu Watanabe [Sat, 28 Dec 2024 04:36:32 +0000 (13:36 +0900)] 
systemctl: also ignore ENOENT in checking inhibitors

Fixes a bug caused by 804874d26ac73e0af07c4c5d7165c95372f03f6d.
Follow-up for a1417e5563acb73a0accdc12b3af91e4ec1c7f46.
Fixes #35757.

(cherry picked from commit 084f361b509cbffe7ffd5ab6085469f76f799fe5)

10 months agoobs: also trigger Fedora package builds
Luca Boccassi [Tue, 7 Jan 2025 00:40:02 +0000 (00:40 +0000)] 
obs: also trigger Fedora package builds

The package is logistically separated, as the rpm sources conflict from Fedora
conflict with the rpm sources from SUSE (some files have the same name and
location but different, incompatible content), so Fedora builds can't be
triggered from the same package. The result is the same.

(cherry picked from commit 5c4cb68390a4a3b60d2ca733e283c44fcc205df7)

10 months agoCI: add OBS workflow integration to build packages on push to main
Luca Boccassi [Mon, 6 Jan 2025 10:45:21 +0000 (10:45 +0000)] 
CI: add OBS workflow integration to build packages on push to main

When main is updated, packages for Arch/Debian/Ubuntu/SUSE will be built and published
on OBS:

https://download.opensuse.org/repositories/home:/bluca:/systemd/
https://build.opensuse.org/project/show/home:bluca:systemd
(cherry picked from commit 0b5f9269398d1422bb7ff3f928a4ffe67332ff63)

10 months agoRevert "mkosi: Fix opensuse build"
Daan De Meyer [Tue, 7 Jan 2025 15:25:03 +0000 (16:25 +0100)] 
Revert "mkosi: Fix opensuse build"

The commit that changes the name from README.testsuite to README.md
was never backported (and shouldn't as it would break opensuse's spec)
so revert the corresponding change in the mkosi opensuse build script.

This reverts commit 4162c331dd4fc6657d1f51c90a7a0223e9f4a30d.

10 months agostdio-bridge: fix polled fds
Jacob McNamee [Tue, 7 Jan 2025 11:29:31 +0000 (03:29 -0800)] 
stdio-bridge: fix polled fds

Poll fds associated with the bus instead of hardcoding stdin/stdout.

This is consequential under socket activation, when the provided fd
should be used instead of stdin/stdout.

(cherry picked from commit 9d1c28b2d8422df700e7d94339ac6052a6755c6c)
(cherry picked from commit 59f5a4323468befbdca2bae7907219eaf8852f9a)

10 months agofmf: Check out target branch in packit
Daan De Meyer [Tue, 7 Jan 2025 13:39:53 +0000 (14:39 +0100)] 
fmf: Check out target branch in packit

(cherry picked from commit 3c9ffd2e4b81e6bbc8cb28634432b6c9dccd661e)

10 months agopackit: Simplify configuration
Daan De Meyer [Mon, 6 Jan 2025 12:44:03 +0000 (13:44 +0100)] 
packit: Simplify configuration

(cherry picked from commit 86a6d7cc5a4798e614c50ed02c751e71f74637f9)

10 months agomkosi: Install which in build image
Daan De Meyer [Tue, 7 Jan 2025 11:23:09 +0000 (12:23 +0100)] 
mkosi: Install which in build image

Required by gdb-add-index to find gdb and not declared as a dependency
of the package.

(cherry picked from commit 414fe9629cebf1ca2dc4c38d82ad8872a5483e89)

10 months agohwdb: comment out the entry for Logitech MX Keys for Mac
Yu Watanabe [Fri, 20 Dec 2024 18:13:18 +0000 (03:13 +0900)] 
hwdb: comment out the entry for Logitech MX Keys for Mac

This effectively reverts the commit f70e5620b6ac319beac1d5ce26331bdc48d25daa,
as the entry seems to match multiple models.

Fixes #35691.

(cherry picked from commit 52a2b049476b374dea2efa22d39c5a1944125c47)

10 months agotest: answer 2nd mdadm --create question for compat with new version
Luca Boccassi [Sun, 22 Dec 2024 13:31:36 +0000 (13:31 +0000)] 
test: answer 2nd mdadm --create question for compat with new version

New version of mdadm now asks a second question, so send 'y' twice
to it in the test scripts

[    5.253483] TEST-64-UDEV-STORAGE.sh[684]: + echo y
[    5.254412] TEST-64-UDEV-STORAGE.sh[685]: + mdadm --create /dev/md/mdmirror --name mdmirror --uuid aaaaaaaa:bbbbbbbb:cccccccc:00000001 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm0 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm1 -v -f --level=1 --raid-devices=2
[    5.254759] TEST-64-UDEV-STORAGE.sh[685]: To optimalize recovery speed, it is recommended to enable write-indent bitmap, do you want to enable it now? [y/N]? mdadm: Note: this array has metadata at the start and
[    5.255085] TEST-64-UDEV-STORAGE.sh[685]:     may not be suitable as a boot device.  If you plan to
[    5.255418] TEST-64-UDEV-STORAGE.sh[685]:     store '/boot' on this device please ensure that
[    5.255745] TEST-64-UDEV-STORAGE.sh[685]:     your boot-loader understands md/v1.x metadata, or use
[    5.256285] TEST-64-UDEV-STORAGE.sh[685]:     --metadata=0.90
[    5.256672] TEST-64-UDEV-STORAGE.sh[685]: mdadm: size set to 64512K
[    5.257063] TEST-64-UDEV-STORAGE.sh[685]: Continue creating array [y/N]? mdadm: create aborted.

This is backward compatible with the older version that asks just one
question

(cherry picked from commit 16406420ea449b75e70a7dced05d7b98bc0f5376)

10 months agocore/unit-serialize: fix serialization of markers
Mike Yuan [Thu, 26 Dec 2024 20:15:44 +0000 (21:15 +0100)] 
core/unit-serialize: fix serialization of markers

Follow-up for ff68472a20c208121b69ea13586f3105a219bc14

(cherry picked from commit 5ce8d7d83902e920a34488c4193d9bc4b5bb70ae)

10 months agocreds: fix use-after-free in varlink interface
Luca Boccassi [Fri, 27 Dec 2024 15:06:39 +0000 (15:06 +0000)] 
creds: fix use-after-free in varlink interface

All other usages of sd_varlink_call* do not free the json return parameter,
and it is owned by the varlink object instead. Do the same here.

TEST-54-CREDS.sh[1074]: ==1074==ERROR: AddressSanitizer: heap-use-after-free on address 0x50c00000095a at pc 0x55cf8cd18a0f bp 0x7ffd7b9d4f10 sp 0x7ffd7b9d4f08
TEST-54-CREDS.sh[1074]: READ of size 2 at 0x50c00000095a thread T0 ((sd-mkdcreds))
TEST-54-CREDS.sh[1074]:     #0 0x55cf8cd18a0e in sd_json_variant_unref /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:887:16
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd4cecb in varlink_clear_current /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:593:22
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cd4975e in varlink_clear /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:614:9
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cd3dc3c in varlink_destroy /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:651:9
TEST-54-CREDS.sh[1074]:     #4 0x55cf8cd3dc3c in sd_varlink_unref /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:657:1
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cb47a82 in sd_varlink_unrefp /usr/src/debug/systemd/src/systemd/sd-varlink.h:279:1
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cb47a82 in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1660:1
TEST-54-CREDS.sh[1074]:     #7 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #9 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #10 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #12 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #13 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #14 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #15 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #16 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #17 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: 0x50c00000095a is located 26 bytes inside of 120-byte region [0x50c000000940,0x50c0000009b8)
TEST-54-CREDS.sh[1074]: freed by thread T0 ((sd-mkdcreds)) here:
TEST-54-CREDS.sh[1074]:     #0 0x7f64b48d57ea in free (/usr/lib/clang/19/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0xd57ea) (BuildId: c59bbd28ceb74038a60373d4a8cd4c258bcf0b4e)
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd188ab in sd_json_variant_unref /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:895:25
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cb47a4c in sd_json_variant_unrefp /usr/src/debug/systemd/src/systemd/sd-json.h:98:1
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cb47a4c in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1660:1
TEST-54-CREDS.sh[1074]:     #4 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #7 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #9 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #10 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #12 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #13 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #14 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: previously allocated by thread T0 ((sd-mkdcreds)) here:
TEST-54-CREDS.sh[1074]:     #0 0x7f64b48d5a83 in malloc (/usr/lib/clang/19/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0xd5a83) (BuildId: c59bbd28ceb74038a60373d4a8cd4c258bcf0b4e)
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd16bb7 in malloc_multiply /usr/src/debug/systemd/src/basic/alloc-util.h:119:16
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cd16bb7 in sd_json_variant_new_object /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:737:13
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cd32e58 in json_parse_internal /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3161:29
TEST-54-CREDS.sh[1074]:     #4 0x55cf8cd37326 in sd_json_parse_with_source /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3408:16
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cd37326 in sd_json_parse /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3437:16
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cd3f753 in varlink_parse_message /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:962:13
TEST-54-CREDS.sh[1074]:     #7 0x55cf8cd3f753 in sd_varlink_process /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:1466:13
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cd4c0a9 in sd_varlink_call_full /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2160:21
TEST-54-CREDS.sh[1074]:     #9 0x55cf8cd4d617 in sd_varlink_callb_ap /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2237:16
TEST-54-CREDS.sh[1074]:     #10 0x55cf8cd4da3c in sd_varlink_callb /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2251:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8cb47686 in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1623:13
TEST-54-CREDS.sh[1074]:     #12 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #13 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #14 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #15 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #16 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #17 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #18 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #19 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #20 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #21 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #22 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: SUMMARY: AddressSanitizer: heap-use-after-free /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:887:16 in sd_json_variant_unref
TEST-54-CREDS.sh[1074]: Shadow bytes around the buggy address:
TEST-54-CREDS.sh[1074]:   0x50c000000680: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
TEST-54-CREDS.sh[1074]:   0x50c000000780: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
TEST-54-CREDS.sh[1074]:   0x50c000000800: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000880: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
TEST-54-CREDS.sh[1074]: =>0x50c000000900: fa fa fa fa fa fa fa fa fd fd fd[fd]fd fd fd fd
TEST-54-CREDS.sh[1074]:   0x50c000000980: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]: Shadow byte legend (one shadow byte represents 8 application bytes):
TEST-54-CREDS.sh[1074]:   Addressable:           00
TEST-54-CREDS.sh[1074]:   Partially addressable: 01 02 03 04 05 06 07
TEST-54-CREDS.sh[1074]:   Heap left redzone:       fa
TEST-54-CREDS.sh[1074]:   Freed heap region:       fd
TEST-54-CREDS.sh[1074]:   Stack left redzone:      f1
TEST-54-CREDS.sh[1074]:   Stack mid redzone:       f2
TEST-54-CREDS.sh[1074]:   Stack right redzone:     f3
TEST-54-CREDS.sh[1074]:   Stack after return:      f5
TEST-54-CREDS.sh[1074]:   Stack use after scope:   f8
TEST-54-CREDS.sh[1074]:   Global redzone:          f9
TEST-54-CREDS.sh[1074]:   Global init order:       f6
TEST-54-CREDS.sh[1074]:   Poisoned by user:        f7
TEST-54-CREDS.sh[1074]:   Container overflow:      fc
TEST-54-CREDS.sh[1074]:   Array cookie:            ac
TEST-54-CREDS.sh[1074]:   Intra object redzone:    bb
TEST-54-CREDS.sh[1074]:   ASan internal:           fe
TEST-54-CREDS.sh[1074]:   Left alloca redzone:     ca
TEST-54-CREDS.sh[1074]:   Right alloca redzone:    cb

Follow-up for 2c3cbc5c018e05b3a3e5ec6c6a2da6f3c6c3fb09

(cherry picked from commit 842a674d4f7fb69af28e67f447c1250383e50f41)

10 months agomachine: GC machine when no leader PID is set
Yu Watanabe [Sat, 28 Dec 2024 02:38:24 +0000 (11:38 +0900)] 
machine: GC machine when no leader PID is set

After d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4, if a serialized
leader PID of a machine is already dead when deserialized, then the
leader PID and PIDFD are unset for the machine, and subsequent
machine_start() -> machine_watch_pidfd() will trigger an assertion.
This makes a Machine object without leader PID GCed.

Fixes a bug introduced by the combination of
d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4 (v255) and
1762c2c045d3a78d3cad54c6b1e5ee9624b32b00 (v257).

Fixes #35602.

(cherry picked from commit 51a0a3b0494d01c1622f6d0c3e2c31e01c18612f)