]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 months agochase: trigger automount only when explicitly requested 38641/head
Yu Watanabe [Thu, 14 Aug 2025 16:22:30 +0000 (17:22 +0100)] 
chase: trigger automount only when explicitly requested

Since c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6
file searching implies a new mount api syscall by default,
to trigger automounts.

But, this is not necessary in most cases, e.g. when chasing
syspath in sd-device (actually this causes regression in umockdev,
see https://github.com/martinpitt/umockdev/issues/271).
Another example is reading unit files, especially .network files,
as automount may trigger mounting network filesystems...

Also, when this is used in NSS plugins, programs that load the
plugins may fail because of spuriously configured seccomp. See #38565.

Let's not trigger automount by default, and do only when explicitly
requested.

This introduces CHASE_TRIGGER_AUTOFS, and use it in
- service manager,
- bootctl and finding ESP/xbootldr,
- sysupdate,
- mountfsd,
- systemd-mount.

There may be several more places we should trigger automount, but let's
do that later.

Follow-up for c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6.
Fixes #38565.
Replaces #38569.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
2 months agochase: introduce CHASE_NO_SHORTCUT_MASK
Yu Watanabe [Tue, 19 Aug 2025 14:45:40 +0000 (23:45 +0900)] 
chase: introduce CHASE_NO_SHORTCUT_MASK

2 months agoRevert "chase: invert CHASE_NO_AUTOFS and only set it where needed"
Yu Watanabe [Tue, 19 Aug 2025 15:09:34 +0000 (00:09 +0900)] 
Revert "chase: invert CHASE_NO_AUTOFS and only set it where needed"

This reverts commit 490aa05ca1ba8e3e2a5ed13e1a77f5ea9f1c93b0.

As commented https://github.com/systemd/systemd/pull/38569#discussion_r2284978273,
the commit makes autofs check bypassed. Before the commit, when
CHASE_NO_AUTOFS is set, we did not shortcut chasing paths, and refused
any autofs mount points in the path. However, with the commit, the flag
was swapped but even when CHASE_AUTOFS is unset, the autofs check may be
skipped.

To fix the issue, rather than swapping the flag, we should introduce
another flag, say CHASE_TRIGGER_AUTOFS. This revert the commit, and in a
later commit, the new flag will be introduced.

2 months agoAdd padding to sbat section (#38621)
Luca Boccassi [Tue, 19 Aug 2025 16:49:07 +0000 (17:49 +0100)] 
Add padding to sbat section (#38621)

2 months agosd-stub: use memory proto if available and set kernel memory to RX with NX_COMPAT
Luca Boccassi [Mon, 11 Aug 2025 14:33:35 +0000 (15:33 +0100)] 
sd-stub: use memory proto if available and set kernel memory to RX with NX_COMPAT

When NX_COMPAT gets enabled, firmwares will enforce that executable
memory is either writable or executable.
This needs kernel compatibility, when it will happen the kernel will
have the NX_COMPAT bit set. If it is, set the memory buffer to RO.

Note that this must be undone on failure, as EDK2 in some configurations
overwrites memory ranges that are returned with FreePages() with a
fixed pattern, so if the pages are RO it will crash.

This is only an issue with the new custom PE loader, as LoadImage()
and StartImage() will always do the right thing automatically.

https://microsoft.github.io/mu/WhatAndWhy/enhancedmemoryprotection/
https://www.kraxel.org/blog/2023/12/uefi-nx-linux-boot/

Follow-up for cab9c7b5a42effa8a45611fc6b8556138c869b5f

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

2 months agochase: invert CHASE_NO_AUTOFS and only set it where needed
Luca Boccassi [Thu, 14 Aug 2025 16:22:30 +0000 (17:22 +0100)] 
chase: invert CHASE_NO_AUTOFS and only set it where needed

Since https://github.com/systemd/systemd/commit/c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6
file searching implies a new mount api syscall by default,
to trigger automounts.

This is problematic in NSS plugins, as they are dlopen'ed inside
processes by glibc, for two reasons.

First of all, potentially searching on a networked filesystem
automount could lead to nasty surprises, such as the process
responsible for setting up the network filesystem trying to
search on that same filesystem.

More importantly, the new mount api syscall was never part of
the filesystem seccomp filter that we provide by default, and
given mounting/remounting/bind mounting is one of the possible
ways to bypass sandboxing it is very likely not allowed when
custom filters are used in sandboxed processes, if they don't
need to do these operations otherwise.
The filesystem seccomp mask we provide has been updated, however
this only takes effect on the next restart of a service. When
systemd is upgraded via a package upgrade, the new nss plugin is
installed and will be immediately dlopen'ed by glibc when needed,
without waiting for the process to restart, which means the existing
seccomp filter applies, causing the filter to trigger.
Given it's not really possible for any arbitrary program to
predict which NSS modules glibc will load, given programs do not
configure that and instead nsswitch is set up by the sysadmin,
it's impossible to handle at each process level. It's also not
possible to know when it will be triggered, given the plugin
is not linked in each binary tools like need-restart cannot
even pre-emptively restart services that may be affected.

This means in practice, upgrading from systemd << v258 to >= v258
requires a reboot to avoid either subtle or catastrophic system
failures.

By avoiding to trigger automounts in nss-systemd we can avoid
both issues.

userdb drop-ins are searched for in:

/etc/userdb/
/run/userdb/
/run/host/userdb/
/usr/local/lib/userdb/
/usr/lib/userdb/

none of which are supported as automounts anyway.

Note that this happens only when the userdbd service is not running,
as otherwise nss-systemd will go through the varlink IPC, rather than
doing the searches in-process.

So invert CHASE_NO_AUTOFS to CHASE_AUTOFS and set it in the places where
we do want to trigger automounts, like looking for the ESP.

Follow-up for https://github.com/systemd/systemd/commit/c5de7b14ae2e08d267d8d75bc88934ac6aa7dcd6
Fixes https://github.com/systemd/systemd/issues/38565

2 months agohwdb: map FN key on TongFang X4SP4NAL laptops
Alexander Bruy [Tue, 19 Aug 2025 10:05:00 +0000 (11:05 +0100)] 
hwdb: map FN key on TongFang X4SP4NAL laptops

2 months agotest: also edit /etc/os-release if it's not a symlink when patching /usr/lib/os-relea...
Luca Boccassi [Tue, 19 Aug 2025 11:32:00 +0000 (12:32 +0100)] 
test: also edit /etc/os-release if it's not a symlink when patching /usr/lib/os-release (#38628)

mkosi patches up /etc/os-release to add local IDs and fixup certain
issues, so when tests patch /usr/lib/ on the fly, copy to the version in
/etc/ too to avoid test failures when querying

6370s 10/98 systemd:integration-tests / TEST-07-PID1 FAIL 31.03s exit
status 1
6370s 25/98 systemd:integration-tests / TEST-29-PORTABLE FAIL 12.76s
exit status 1
6370s 33/98 systemd:integration-tests / TEST-43-PRIVATEUSER-UNPRIV FAIL
6.57s exit status 1
6370s 37/98 systemd:integration-tests / TEST-50-DISSECT FAIL 16.97s exit
status 1

This is particularly an issue when running these tests on debian unstable,
where mkosi has to fixup os-release to make it valid and avoid further
breakages:

https://github.com/systemd/mkosi/blob/main/mkosi/distributions/debian.py#L234

2 months agoimportd: accept a single space as SHA256SUMS separator
Lennart Poettering [Tue, 19 Aug 2025 07:23:07 +0000 (09:23 +0200)] 
importd: accept a single space as SHA256SUMS separator

The SHA256SUMS files provided by https://images.linuxcontainers.org/
are slightly non-conforming, insted of using " *" or "  " as separator
between hash and file name they use " ". Let's accept that too, in the
interest of maximizing compatibility.

2 months agomountfsd: include polkit allowInteractiveAuthorization field in IDL
Lennart Poettering [Mon, 18 Aug 2025 21:19:40 +0000 (23:19 +0200)] 
mountfsd: include polkit allowInteractiveAuthorization field in IDL

Otherwise this option can never be actually used, as the IDL checker
will refuse any attempts to pass it.

Follow-up for: 0261fe571b3e05834b4c7826447ac6e6e434f08e

2 months agodissect-image: fix two log messages in mountfsd_mount_directory_fd()
Lennart Poettering [Mon, 18 Aug 2025 21:19:06 +0000 (23:19 +0200)] 
dissect-image: fix two log messages in mountfsd_mount_directory_fd()

Let's fix some copypasta and make the log messages actually match what
they are about.

2 months agoukify: stop appending NUL to merged .sbat section 38621/head
Zbigniew Jędrzejewski-Szmek [Tue, 19 Aug 2025 09:11:28 +0000 (11:11 +0200)] 
ukify: stop appending NUL to merged .sbat section

Our tools will strip trailing NULs, so this is not causing harm, except for
the corner case when the .sbat section is exactly of the maximum size and now
it wouldn't fit because we're one byte short.

But it also is not needed. Sections have an encoded size of the data and the
reader must use that and must be prepared to handle a text section that does
not end in NUL. Appending of the NUL was added in
c3f7501c4d014482b17988d5aed1d88127a50b6e, without any discussion of this
change. Since we didn't insert the NUL before, the tools must have been
prepared to work without it. I think it's better to keep the code clean and
not do this unnecessary step.

2 months agosd-boot: pad .sbat section to 1k bytes
Zbigniew Jędrzejewski-Szmek [Mon, 18 Aug 2025 07:43:26 +0000 (09:43 +0200)] 
sd-boot: pad .sbat section to 1k bytes

Fedora's kernels now ship with a .sbat section:
  kernel,1,Red Hat,kernel-core,6.17.0-0.rc1.250814g0cc53520e68b.20.fc44.x86_64,mailto:secalert@redhat.com
  kernel.fedora,1,Red Hat,kernel-core,6.17.0-0.rc1.250814g0cc53520e68b.20.fc44.x86_64,mailto:secalert@redhat.com
This pushes the combined .sbat section just over its pre-allocated size of 512 bytes:
  File "/usr/bin/ukify", line 1048, in pe_add_sections
    raise PEError(f'Not enough space in existing section {section.name} to append new data')
  PEError: Not enough space in existing section .sbat to append new data

PE sections need to align to 512 bytes, so to make it all fit we pad the .sbat
section with zeros to 1k. Various tools already should strip trailing zeros when
using sbat sections, since ukify always inserts a trailing NUL.

The defines are moved to sbat.h, they are used only in sd-stub and sd-boot.

2 months agoukify: fix insertion of padding in merged sections
Zbigniew Jędrzejewski-Szmek [Tue, 19 Aug 2025 09:02:44 +0000 (11:02 +0200)] 
ukify: fix insertion of padding in merged sections

The padding was done to expand the new section contents to the expected size of
the new section. And this then would be used for the content in the existing
section. The new section cannot be larger than the old section, but it can be
smaller. If the new section was smaller, then we'd not write enough padding and
the output file would be corrupted.

This was observed in CI when the .sbat section in the stub was padded to 1k.
The UKI with an .sbat section that was merged and was fairly short would hit
this scenario and be corrupted.

2 months agoukify: adjust comments
Zbigniew Jędrzejewski-Szmek [Tue, 19 Aug 2025 07:25:32 +0000 (09:25 +0200)] 
ukify: adjust comments

2 months agoukify: extend error message when section is too small
Zbigniew Jędrzejewski-Szmek [Mon, 18 Aug 2025 19:42:10 +0000 (21:42 +0200)] 
ukify: extend error message when section is too small

2 months agopo: Translated using Weblate (Portuguese)
Américo Monteiro [Tue, 19 Aug 2025 03:15:40 +0000 (03:15 +0000)] 
po: Translated using Weblate (Portuguese)

Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Américo Monteiro <a_monteiro@gmx.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt/
Translation: systemd/main

2 months agopo: Translated using Weblate (Spanish)
Fco. Javier F. Serrador [Tue, 19 Aug 2025 03:15:40 +0000 (03:15 +0000)] 
po: Translated using Weblate (Spanish)

Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Fco. Javier F. Serrador <fserrador@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main

2 months agoukify: rstrip and escape binary null characters from 'inspect' output (#38607)
Li Tian [Mon, 18 Aug 2025 21:43:41 +0000 (05:43 +0800)] 
ukify: rstrip and escape binary null characters from 'inspect' output (#38607)

SBAT section of UKI may contain \u000 null characters. Rstrip them, and if there's anything left in the middle,
escape them so they are displayed as text.

Fixes #38606

2 months agotree-wide: don't play games with alignment around file_handle
Lennart Poettering [Mon, 18 Aug 2025 07:09:59 +0000 (09:09 +0200)] 
tree-wide: don't play games with alignment around file_handle

The payload of a file_handle structure is not 64bit aligned. So far used
_alignas_() to align it to 64bit as a whole, which by accident has the
side-effect that the payload ends up being aligned to 64bit too, but
this is ugly, because it's really just an accident...

Let's do this properly, and just use proper unaligned 64bit reads to
access the field, and do not assume aligning the structure as a whole
also aligns the payload part of it.

Follow-up for: fd51a7d8b5b1c710c3b59e877bc35b2739dcc350

2 months agoptyfwd: do not try to read from PTYForward.input_fd when read-only mode
Yu Watanabe [Mon, 18 Aug 2025 06:46:04 +0000 (15:46 +0900)] 
ptyfwd: do not try to read from PTYForward.input_fd when read-only mode

Fixes the following error message (the last line):
```
[FAILED] Failed to start TEST-60-MOUNT-RATELIMIT.service.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
All filesystems, swaps, loop devices, MD devices and DM devices detached.
Exiting container.
Failed to read from pty input fd: Bad file descriptor
```

Follow-up for b823809bca6cd531a54fcf0f02427aea7cd3e651 and
cf89e48028ed3b651f63ba624175394c3c0d8efa.

2 months agocryptsetup: reference right variable
Lennart Poettering [Mon, 18 Aug 2025 07:30:19 +0000 (09:30 +0200)] 
cryptsetup: reference right variable

Fixes: #38576
2 months agotest-nss-hosts: do not call seccomp functions if HAVE_SECCOMP is not set
Antonio Alvarez Feijoo [Mon, 18 Aug 2025 08:05:23 +0000 (10:05 +0200)] 
test-nss-hosts: do not call seccomp functions if HAVE_SECCOMP is not set

Otherwise, the build fails:

```
  Features
...
    disabled                                 : ACL, SECCOMP, ...
...
[1592/2115] Compiling C object test-nss-hosts.p/src_test_test-nss-hosts.c.o
FAILED: test-nss-hosts.p/src_test_test-nss-hosts.c.o
...
In file included from ../src/test/test-nss-hosts.c:27:
../src/test/test-nss-hosts.c: In function ‘run’:
../src/test/test-nss-hosts.c:497:43: error: implicit declaration of function ‘seccomp_filter_set_add_by_name’ [-Werror=implicit-function-declaration]
  497 |                                 ASSERT_OK(seccomp_filter_set_add_by_name(filter, /* add = */ true, s));
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:497:43: warning: nested extern declaration of ‘seccomp_filter_set_add_by_name’ [-Wnested-externs]
  497 |                                 ASSERT_OK(seccomp_filter_set_add_by_name(filter, /* add = */ true, s));
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:35: error: implicit declaration of function ‘seccomp_load_syscall_filter_set_raw’ [-Werror=implicit-function-declaration]
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:35: warning: nested extern declaration of ‘seccomp_load_syscall_filter_set_raw’ [-Wnested-externs]
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:71: error: ‘SCMP_ACT_ALLOW’ undeclared (first use in this function)
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                                                       ^~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:71: note: each undeclared identifier is reported only once for each function it appears in
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                                                       ^~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:95: error: implicit declaration of function ‘SCMP_ACT_ERRNO’ [-Werror=implicit-function-declaration]
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                                                                               ^~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-nss-hosts.c:498:95: warning: nested extern declaration of ‘SCMP_ACT_ERRNO’ [-Wnested-externs]
  498 |                         ASSERT_OK(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, filter, SCMP_ACT_ERRNO(ENOSYS), /* log_missing = */ true));
      |                                                                                               ^~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
cc1: some warnings being treated as errors
```

Fixes 788b3e030e717404cbb65b4261bff2ef7ddb1b90

2 months agofundamental/macro: adjust indentation of ifdefs
Zbigniew Jędrzejewski-Szmek [Mon, 18 Aug 2025 07:22:34 +0000 (09:22 +0200)] 
fundamental/macro: adjust indentation of ifdefs

2 months agovmspawn: fix --smbios
Luca Boccassi [Sun, 17 Aug 2025 23:34:22 +0000 (00:34 +0100)] 
vmspawn: fix --smbios

The file used to pass credentials gets created and then immediately deleted:

$ systemd-vmspawn -i image.raw -s "io.systemd.credential.binary:tty.serial.hvc0.agetty.autologin=cm9vdA=="
░ Spawning VM opensuse-2025081621.1 on /tmp/image.raw.
░ Press Ctrl-] three times within 1s to kill VM.
Not overwriting existing state file.
Listening on /run/user/1000/systemd/vmspawn.1c00857c6a3dc2c7/tpm.sock as 3.
qemu-system-x86_64: -smbios type=11,path=/var/tmp/vmspawn-smbios-Hizb4A/.#smbios11e5a842e77d7b4b68: Could not open '/var/tmp/vmspawn-smbios-Hizb4A/.#smbios11e5a842e77d7b4b68': No such file or directory

Follow-up for a79e94aa58a1b112d95ae27e4931bf5a8817ef05

2 months agodocs: fix typo
Salim B [Sun, 17 Aug 2025 19:37:12 +0000 (21:37 +0200)] 
docs: fix typo

2 months agohwdb: Add Accelerometer mount matrix for Irbis TW43
Rostislav Lastochkin [Sun, 17 Aug 2025 15:59:25 +0000 (18:59 +0300)] 
hwdb: Add Accelerometer mount matrix for Irbis TW43

2 months agoREADME: drop one FIXME comment
Yu Watanabe [Sun, 17 Aug 2025 16:15:33 +0000 (01:15 +0900)] 
README: drop one FIXME comment

Most compat glue has been already removed, except for several cgroup v1
specific codes. It is too late to remove the remaining things before v258.
Let's remove them after v258.

2 months agocryptsetup: HAVE_CRYPT_SET_KEYRING_TO_LINK is always defined
Yu Watanabe [Sun, 17 Aug 2025 12:05:24 +0000 (21:05 +0900)] 
cryptsetup: HAVE_CRYPT_SET_KEYRING_TO_LINK is always defined

Follow-up for c5daf14c88ba44cefabe052de93a29d28b6b0175 (v256).

2 months agoTEST-17-UDEV: rotate journal after pending journal entries in buffer before flushed
Yu Watanabe [Sat, 16 Aug 2025 19:36:26 +0000 (04:36 +0900)] 
TEST-17-UDEV: rotate journal after pending journal entries in buffer before flushed

Then, expected journal entries should be in the archived journal, hence
hopefully we can safely get them.

Follow-up for 5e4115e59e25fc2eeb31c8f47c3ce1b59835f215.

2 months agocore: fix crash on audit callback
Luca Boccassi [Sat, 16 Aug 2025 22:56:11 +0000 (23:56 +0100)] 
core: fix crash on audit callback

When check_access() was added, the callback data parameter
was changed from a pointer to a double pointer, resulting
in a crash when it is accessed when logging an error:

 #0  __internal_syscall_cancel (a1=a1@entry=0, a2=a2@entry=0,
a3=a3@entry=140726176497168, a4=a4@entry=4, a5=a5@entry=0,
a6=a6@entry=0, nr=247) at ./nptl/cancellation.c:44
 #1  0x00007f5d0ec996ad in __syscall_cancel (a1=a1@entry=0,
a2=a2@entry=0, a3=a3@entry=140726176497168, a4=a4@entry=4,
a5=a5@entry=0, a6=a6@entry=0, nr=247) at ./nptl/cancellation.c:75
 #2  0x00007f5d0ed047ab in __waitid (idtype=idtype@entry=P_ALL,
id=id@entry=0, infop=infop@entry=0x7ffd5dc2be10,
options=options@entry=4) at ../sysdeps/unix/sysv/linux/waitid.c:29
 #3  0x00007f5d0f044412 in freeze () at ../src/basic/process-util.c:2039
 #4  0x00005568f181bc2a in freeze_or_exit_or_reboot () at
../src/core/crash-handler.c:55
 #5  0x00005568f181be82 in crash (sig=<optimized out>, siginfo=<optimized
out>, context=<optimized out>) at ../src/core/crash-handler.c:184
 #6  <signal handler called>
 #7  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
 #8  0x00007f5d0ec6e300 in __printf_buffer (buf=buf@entry=0x7ffd5dc2ca90,
format=0x7f5d0f196e60 "%s: Failed to acquire credentials: %m",
ap=0x7ffd5dc2d3d0, mode_flags=2) at
./stdio-common/vfprintf-process-arg.c:435
 #9  0x00007f5d0ec91daf in __vsnprintf_internal
(string=string@entry=0x7ffd5dc2cb70 "", maxlen=maxlen@entry=2048,
format=format@entry=0x7f5d0f196e60 "%s: Failed to acquire credentials:
%m", args=args@entry=0x7ffd5dc2d3d0, mode_flags=mode_flags@entry=2)
    at ./libio/vsnprintf.c:96
 #10 0x00007f5d0ed27044 in ___vsnprintf_chk (s=s@entry=0x7ffd5dc2cb70 "",
maxlen=maxlen@entry=2048, flag=flag@entry=1, slen=slen@entry=2048,
format=format@entry=0x7f5d0f196e60 "%s: Failed to acquire credentials:
%m", ap=ap@entry=0x7ffd5dc2d3d0)
    at ./debug/vsnprintf_chk.c:34
 #11 0x00007f5d0f02de59 in vsnprintf (__s=0x7ffd5dc2cb70 "", __n=2048,
__fmt=0x7f5d0f196e60 "%s: Failed to acquire credentials: %m",
__ap=0x7ffd5dc2d3d0) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:100
 #12 log_internalv (level=7, error=-9, file=0x7f5d0f196643
"src/libsystemd/sd-varlink/sd-varlink.c", line=2853, func=0x7f5d0f1d5ca0
<__func__.62> "sd_varlink_get_peer_uid", format=0x7f5d0f196e60 "%s:
Failed to acquire credentials: %m",
    ap=0x7ffd5dc2d3d0) at ../src/basic/log.c:865
 #13 0x00007f5d0f02ded5 in log_internalv (level=<optimized out>,
error=<optimized out>, file=<optimized out>, line=<optimized out>,
func=<optimized out>, format=<optimized out>, ap=0x7ffd5dc2d3d0) at
../src/basic/log.c:868
 #14 0x00007f5d0f02df67 in log_internal (level=<optimized out>,
error=<optimized out>, file=<optimized out>, line=<optimized out>,
func=<optimized out>, format=<optimized out>) at ../src/basic/log.c:882
 #15 0x00007f5d0f10a135 in sd_varlink_get_peer_uid (v=0x7f5d0f5ab110
<__func__.44>, ret=ret@entry=0x7ffd5dc2d4f0) at
../src/libsystemd/sd-varlink/sd-varlink.c:2853
 #16 0x00007f5d0f50c29e in audit_callback (auditdata=0x7ffd5dc2d698,
cls=<optimized out>, msgbuf=0x55692366e77d "", msgbufsize=995) at
../src/core/selinux-access.c:65
 #17 0x00007f5d0f716079 in avc_suppl_audit (ptr=0x7ffd5dc2d698, class=95,
buf=<optimized out>, len=<optimized out>) at ./src/avc_internal.h:101
 #18 avc_audit (ssid=0x5569237f2890, tsid=0x556922d7f4b0,
tclass=<optimized out>, requested=<optimized out>, avd=<optimized out>,
result=0, a=0x7ffd5dc2d698) at ./src/avc.c:721
 #19 0x00007f5d0f716367 in avc_has_perm (ssid=0x5569237f2890,
tsid=0x556922d7f4b0, tclass=tclass@entry=95, requested=4,
aeref=aeref@entry=0x0, auditdata=auditdata@entry=0x7ffd5dc2d698) at
./src/avc.c:836
 #20 0x00007f5d0f718b0a in selinux_check_access
(scon=scon@entry=0x55692384cbc0 "system_u:system_r:policykit_t:s0",
tcon=tcon@entry=0x556922c98a20
"system_u:object_r:systemd_networkd_unit_t:s0",
class=class@entry=0x7f5d0f580b9e "service",
    perm=perm@entry=0x7f5d0f580cc0 "status",
aux=aux@entry=0x7ffd5dc2d698) at ./src/checkAccess.c:64
 #21 0x00007f5d0f50bf7e in check_access (scon=0x55692384cbc0
"system_u:system_r:policykit_t:s0", tcon=0x556922c98a20
"system_u:object_r:systemd_networkd_unit_t:s0", tclass=0x7f5d0f580b9e
"service", permission=permission@entry=0x7f5d0f580cc0 "status",
    audit_info=<optimized out>, audit_info@entry=0x7ffd5dc2d720,
error=error@entry=0x7ffd5dc2d880) at ../src/core/selinux-access.c:229
 #22 0x00007f5d0f5100a1 in mac_selinux_access_check_bus_internal
(message=<optimized out>, unit=<optimized out>,
permission=0x7f5d0f580cc0 "status", function=0x7f5d0f5ab110
<__func__.44> "method_get_unit_by_pidfd", error=0x7ffd5dc2d880)
    at ../src/core/selinux-access.c:329
 #23 0x00007f5d0f4a024b in method_get_unit_by_pidfd
(message=0x5569236d9010, userdata=<optimized out>, error=0x7ffd5dc2d880)
at ../src/core/dbus-manager.c:657
 #24 0x00007f5d0f0c9bd0 in method_callbacks_run (bus=0x5569238684e0,
m=0x5569236d9010, c=<optimized out>, require_fallback=false,
found_object=0x7ffd5dc2d947) at ../src/libsystemd/sd-bus/bus-objects.c:413
 #25 object_find_and_run (bus=bus@entry=0x5569238684e0,
m=m@entry=0x5569236d9010, p=<optimized out>,
require_fallback=require_fallback@entry=false,
found_object=found_object@entry=0x7ffd5dc2d947) at
../src/libsystemd/sd-bus/bus-objects.c:1323
 #26 0x00007f5d0f0cafa2 in bus_process_object (bus=0x5569238684e0,
m=0x5569236d9010) at ../src/libsystemd/sd-bus/bus-objects.c:1443
 #27 0x00007f5d0f0d8c3e in process_message (bus=0x5569238684e0,
m=0x5569236d9010) at ../src/libsystemd/sd-bus/sd-bus.c:3006
 #28 process_running (bus=0x5569238684e0, ret=0x0) at
../src/libsystemd/sd-bus/sd-bus.c:3048
 #29 bus_process_internal (bus=bus@entry=0x5569238684e0,
ret=ret@entry=0x0) at ../src/libsystemd/sd-bus/sd-bus.c:3275
 #30 0x00007f5d0f0d9099 in sd_bus_process (bus=bus@entry=0x5569238684e0,
ret=ret@entry=0x0) at ../src/libsystemd/sd-bus/sd-bus.c:3302
 #31 0x00007f5d0f0db3ec in io_callback (s=<optimized out>, fd=<optimized
out>, revents=<optimized out>, userdata=0x5569238684e0) at
../src/libsystemd/sd-bus/sd-bus.c:3643
 #32 0x00007f5d0f0a53d9 in source_dispatch (s=s@entry=0x5569236dea60) at
../src/libsystemd/sd-event/sd-event.c:4163
 #33 0x00007f5d0f0a563d in sd_event_dispatch (e=<optimized out>,
e@entry=0x5569232f6c00) at ../src/libsystemd/sd-event/sd-event.c:4782
 #34 0x00007f5d0f0a6d38 in sd_event_run (e=<optimized out>,
timeout=18446744073709551615) at ../src/libsystemd/sd-event/sd-event.c:4843
 #35 0x00007f5d0f4f7871 in manager_loop (m=m@entry=0x5569232f8250) at
../src/core/manager.c:3310
 #36 0x00005568f181517d in invoke_main_loop (m=0x5569232f8250,
saved_rlimit_nofile=0x7ffd5dc2dcb0, saved_rlimit_memlock=0x7ffd5dc2dca0,
ret_retval=<synthetic pointer>, ret_fds=0x7ffd5dc2dc78,
ret_switch_root_dir=<synthetic pointer>,
    ret_switch_root_init=<synthetic pointer>,
ret_error_message=0x7ffd5dc2dc90) at ../src/core/main.c:2140
 #37 main (argc=<optimized out>, argv=0x7ffd5dc2dfe8) at
../src/core/main.c:3351

Follow-up for fe3f2ac0734e64dcd729b00992a6261cbf4cc846

2 months agomeson: compile nss-util.c only when at least one nss module is enabled
Yu Watanabe [Sat, 16 Aug 2025 20:29:14 +0000 (05:29 +0900)] 
meson: compile nss-util.c only when at least one nss module is enabled

Follow-up for ea70753479fbfe19b4ae5de9db846ab9edd290a8.

2 months agocore/service: do not reset watchdong when unit is frozen
Yu Watanabe [Sat, 16 Aug 2025 16:00:37 +0000 (01:00 +0900)] 
core/service: do not reset watchdong when unit is frozen

Even watchdog for a service is stopped when freezing the unit is
requested, sd-notify message WATCHDOG=1 or friends may come after
that due to ordering of event priority. In that case,
service_reset_watchdog() is called for frozen unit and thus previously
watchdog was reenabled.

Follow-up for 25178aadb2bd04ef9e63f48c1ef42fb309f9332e.
Fixes #38551 (the second failure case).

2 months agoAvoid triggering assertions by nss modules when uname and/or sigprocmask are masked...
Yu Watanabe [Sat, 16 Aug 2025 20:19:00 +0000 (05:19 +0900)] 
Avoid triggering assertions by nss modules when uname and/or sigprocmask are masked (#38586)

Fixes #38582.

2 months agotest: drop unnecessary service file
Yu Watanabe [Sat, 16 Aug 2025 17:03:03 +0000 (02:03 +0900)] 
test: drop unnecessary service file

Such test service unit is now generated automatically.

Follow-up for 7eb276dced3743f4c5a48c9c29f8f373294adb2f.

2 months agoresolve: fix index of comments and rebreak comments
Yu Watanabe [Sat, 16 Aug 2025 17:06:42 +0000 (02:06 +0900)] 
resolve: fix index of comments and rebreak comments

2 months agotest-nss-hosts: add test case for issue #38582 38586/head
Yu Watanabe [Fri, 15 Aug 2025 05:44:13 +0000 (14:44 +0900)] 
test-nss-hosts: add test case for issue #38582

2 months agosignal-util: do not abort when sigprocmask() failed
Yu Watanabe [Fri, 15 Aug 2025 04:57:51 +0000 (13:57 +0900)] 
signal-util: do not abort when sigprocmask() failed

BLOCK_SIGNALS() is also used in nss modules. If an application is
running with a too strict seccomp loads our nss modules, then the
assertion may be triggered.

Fixes #38582.

2 months agonss: move definition of NSS_ENTRYPOINT_BEGIN to nss-util.h
Yu Watanabe [Fri, 15 Aug 2025 06:06:53 +0000 (15:06 +0900)] 
nss: move definition of NSS_ENTRYPOINT_BEGIN to nss-util.h

Then, also make nss modules parse $SYSTEMD_ASSERT_RETURN_IS_CRITICAL
environment variable.

This also moves nss-util.c and nss-util.h from src/basic/ to src/shared/,
as they are not used by libsystemd.

2 months agoassert-util: introduce log_set_assert_return_is_critical_from_env()
Yu Watanabe [Fri, 15 Aug 2025 06:24:07 +0000 (15:24 +0900)] 
assert-util: introduce log_set_assert_return_is_critical_from_env()

It will be used for testing nss modules.

2 months agoassert-util: drop message argument of assert_log()
Yu Watanabe [Fri, 15 Aug 2025 04:51:25 +0000 (13:51 +0900)] 
assert-util: drop message argument of assert_log()

As it is always equals to #expr.

2 months agohostname-setup: do not trigger assertion when uname() is prohibited by seccomp
Yu Watanabe [Fri, 15 Aug 2025 04:21:59 +0000 (13:21 +0900)] 
hostname-setup: do not trigger assertion when uname() is prohibited by seccomp

gethostname_full() is used in nss-myhostname, and hence random
application may indirectly call it. When an application with a too strict
seccomp filter loads the nss module, the application may trigger the
assertion.

Partially fixes #38582.

2 months agoseccomp-util: use consistent argument names
Yu Watanabe [Fri, 15 Aug 2025 07:11:35 +0000 (16:11 +0900)] 
seccomp-util: use consistent argument names

2 months agomkosi: update mkosi ref and debian ref (#38597)
Yu Watanabe [Sat, 16 Aug 2025 14:41:20 +0000 (23:41 +0900)] 
mkosi: update mkosi ref and debian ref (#38597)

2 months agomkosi: update mkosi commit reference to 5598b7f5793b6f63db5afaa39504a763fbaeb5cb 38597/head
Luca Boccassi [Sat, 16 Aug 2025 11:13:20 +0000 (12:13 +0100)] 
mkosi: update mkosi commit reference to 5598b7f5793b6f63db5afaa39504a763fbaeb5cb

5598b7f579 fedora: be more persistent when guessing what rawhide could be
cdd2d1570e Use apt-ftparchive instead of reprepro
eeb4ce6302 fix dead/404 link
30a487d183 mkosi-tools: Drop systemd-boot-efi package
ad4b4d2cbe Add debug logging for version reported by systemd tools
95f5c77fb7 mkosi-tools: move systemd-boot package to conf file matching older releases
7da22f33e0 README: clarify that companion tools can also be enabled from the git repo
ec3fe91532 Drop microsecond resolution for datetime.now()
9f7a53b687 mkosi-initrd: install raid rule with 70 prefix
32c3ff4677 ci: give a hint about possible fixes for failing reuse lints
489c5e9ecc build(deps): bump github/codeql-action from 3.29.2 to 3.29.5

2 months agomkosi: update debian commit reference to 8ba719208ff28f36bc240328725eb10008838c39
Luca Boccassi [Sat, 16 Aug 2025 11:11:46 +0000 (12:11 +0100)] 
mkosi: update debian commit reference to 8ba719208ff28f36bc240328725eb10008838c39

8ba719208f systemd-boot: install kernel hooks to /usr/share/
c4d6093398 Update changelog for 258~rc2-2 release
b21987b0f9 More NEWS updates about sysv support
cd7d07f66b NEWS: fixlets and adjustments
34ef04cb45 Stop installing /var/lib/systemd in the package
08b77c5b7c Update changelog for 258~rc2-1 release
48b3ec2b9a systemd-container: update lintian overrides for more false positives
31547d827b systemd-boot: make efibootmgr a dependency
88a7261c00 d/t/control: prefer systemd-boot-tools if available
478ea8945f systemd-boot: fix registering/removing uncompressed kernels
b072f60375 NEWS: fix typo
985a3c8d56 systemd-boot: register interest in systemd-boot-signed trigger
f13b262bf6 d/rules: set debugoptimized for upstream builds
615f8851e8 Install usr/share/factory files and restore nsswitch.conf/pam.d/issue on factory reset
61792528f2 Update changelog for 258~rc1-1 release
116371a1df d/copyright: update paths
41437c9c54 Add a few more conflicts to packages providing the same files
0e5eea70fd Fix Lintian warning debian-news-entry-uses-asterisk
60595acb01 Update Lintian overrides
b8662ba796 Update symbols file for 258~rc1
58553602ca NEWS: note removal of telinit/runlevel
d78ade0842 Drop all workarounds that are obsolete after trixie
7ef47f9f6b Drop world-writable /run/lock debianism
9d6d3a4154 NEWS: note cgroupv1 removal
ef2ef6f35d Enable sd-vmspawn
ac2aec3b68 Add and remove files for 258~rc1
06582be4e6 d/watch: remove restriction to v257.x series
88ccb1552a salsa-ci: enable arm64 build

2 months agotest: fix typo in comment
Luca Boccassi [Sat, 16 Aug 2025 09:53:07 +0000 (10:53 +0100)] 
test: fix typo in comment

2 months agopidfd-util: force alignment of file_handle union to avoid assert on 32bit
Luca Boccassi [Fri, 15 Aug 2025 09:42:39 +0000 (10:42 +0100)] 
pidfd-util: force alignment of file_handle union to avoid assert on 32bit

On 32bit the union won't be aligned automatically, needs to be enforced:

Assertion '((uintptr_t) _p) % alignof(uint64_t) == 0' failed at src/basic/pidfd-util.c:251, function pidfd_get_inode_id_impl(). Aborting.

Follow-up for 9c039ef5ff7f683aa9f7a36cb39bac94a12964b2

2 months agomkosi: install util-linux-script on F44
Luca Boccassi [Thu, 14 Aug 2025 15:43:38 +0000 (16:43 +0100)] 
mkosi: install util-linux-script on F44

Once F41 is EOL we can just move this to the main list and
stop doing this dance every 6 months

2 months agoman: add missing comma
Yu Watanabe [Thu, 14 Aug 2025 14:33:39 +0000 (23:33 +0900)] 
man: add missing comma

2 months agoReuse the parent_image handle and parent_loaded_image
Mate Kukri [Thu, 7 Aug 2025 16:28:58 +0000 (17:28 +0100)] 
Reuse the parent_image handle and parent_loaded_image

- Reuse parent_image instead of allocating new ones. Firmware might cast
  EFI_LOADED_IMAGE_PROTOCOL * to a larger struct causing issues
- Remove loaded image protocol installation and uninstallation which are no
  longer required

Fixes a bug introduced by cab9c7b5a42effa8a45611fc6b8556138c869b5f.
Fixes #38567.

Co-authored-by: Tobias Heider <tobias.heider@canonical.com>
2 months agocondition: fix unexpected assertion triggered
Yu Watanabe [Thu, 14 Aug 2025 07:05:52 +0000 (16:05 +0900)] 
condition: fix unexpected assertion triggered

Follow-up for c154bb65ad55a98fdf7d05fcb6b68a22408ea33a.
Fixes oss-fuzz#438513119.
Fixes #38570.

2 months agoupdate TODO
Lennart Poettering [Thu, 14 Aug 2025 06:34:32 +0000 (08:34 +0200)] 
update TODO

2 months agoukify: drop NX bit from UKI if kernel doesn't have it
Luca Boccassi [Tue, 12 Aug 2025 22:09:06 +0000 (23:09 +0100)] 
ukify: drop NX bit from UKI if kernel doesn't have it

If the kernel is not NX_COMPAT ready (W^X memory compatible) then the
UKI should not be marked as NX_COMPAT ready either, as the kernel
section is the loadable code in the image.

https://microsoft.github.io/mu/WhatAndWhy/enhancedmemoryprotection/
https://www.kraxel.org/blog/2023/12/uefi-nx-linux-boot/

While the sd-stub EFI code itself is NX ready, it is more useful
to think of it as one unit of execution together with the kernel
it embeds, as that's what it is used for.

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

2 months agotree-wide: various terminal related fixlets (#38544)
Yu Watanabe [Wed, 13 Aug 2025 18:40:44 +0000 (03:40 +0900)] 
tree-wide: various terminal related fixlets (#38544)

Fixes #38524.
Fixes #38527.
Fixes #38552.

2 months agocore: do not start watchdog for frozen service on daemon-reload/-reexec (#38553)
Yu Watanabe [Wed, 13 Aug 2025 16:18:50 +0000 (01:18 +0900)] 
core: do not start watchdog for frozen service on daemon-reload/-reexec (#38553)

Fixes #38551.

2 months agoTEST-72-SYSUPDATE: fix indentation and drop space in blank line 38544/head
Yu Watanabe [Wed, 13 Aug 2025 14:53:13 +0000 (23:53 +0900)] 
TEST-72-SYSUPDATE: fix indentation and drop space in blank line

2 months agoTEST-72-SYSUPDATE: make randomly generated image file not have compression header
Yu Watanabe [Wed, 13 Aug 2025 06:57:15 +0000 (15:57 +0900)] 
TEST-72-SYSUPDATE: make randomly generated image file not have compression header

Otherwise, the generated image may be wrongly detected as compressed,
and importing the image may fail:
```
[   35.194578] TEST-72-SYSUPDATE.sh[411]: + dd if=/dev/urandom of=/var/tmp/test-72-N7uTeO/source/part1-v5.raw bs=4096 count=2048
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 2048+0 records in
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 2048+0 records out
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 8388608 bytes (8.4 MB, 8.0 MiB) copied, 0.0408601 s, 205 MB/s
(snip)
[   35.948634] TEST-72-SYSUPDATE.sh[1085]: \ Acquiring /var/tmp/test-72-N7uTeO/source/part1-v5.raw → /proc/self/fd/3p2...
[   35.952878] TEST-72-SYSUPDATE.sh[1085]: Successfully forked off '(sd-import-raw)' as PID 1089.
[   35.958952] TEST-72-SYSUPDATE.sh[1089]: Importing '/var/tmp/test-72-N7uTeO/source/part1-v5.raw', saving at offset 9437184 in '/dev/loop0'.
[   35.959575] TEST-72-SYSUPDATE.sh[1089]: Failed to decode and write: Input/output error
[   35.959575] TEST-72-SYSUPDATE.sh[1089]: Exiting.
```

Fixes #38524.

2 months agoimport: add a debugging log of importing blob
Yu Watanabe [Wed, 13 Aug 2025 06:26:35 +0000 (15:26 +0900)] 
import: add a debugging log of importing blob

This should be helpful for debugging issue #38524.

2 months agoimport: align table
Yu Watanabe [Wed, 13 Aug 2025 06:22:41 +0000 (15:22 +0900)] 
import: align table

2 months agoimport,sysupdate: make notify event processed before SIGCHLD of worker processes
Yu Watanabe [Wed, 13 Aug 2025 05:35:51 +0000 (14:35 +0900)] 
import,sysupdate: make notify event processed before SIGCHLD of worker processes

This fixes the following warning:
```
[    5.628796] TEST-13-NSPAWN.sh[299]: + importctl import-raw --class=confext /var/tmp/importtest
(snip)
[    5.638894] systemd-importd[302]: (transfer1) Operation completed successfully.
[    5.640760] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^MTotal:  40%
[    5.638902] systemd-importd[302]: (transfer1) Exiting.
[    5.638931] systemd-importd[302]: Got percentage from client: 40%
[    5.638956] systemd-importd[302]: Transfer process succeeded.
[    5.638988] systemd-importd[302]: Got notification datagram from unexpected peer, ignoring.
```

2 months agopretty-print: show progress bar only when we are running on a TTY
Yu Watanabe [Wed, 13 Aug 2025 05:17:10 +0000 (14:17 +0900)] 
pretty-print: show progress bar only when we are running on a TTY

Otherwise, when a command is running with e.g. StandardError=journal+console,
journal contains [xxxB blob data]:
```
[    5.628796] TEST-13-NSPAWN.sh[299]: + importctl import-raw --class=confext /var/tmp/importtest
[    5.632350] systemd-importd[302]: Successfully forked off '(sd-transfer)' as PID 319.
[    5.633671] TEST-13-NSPAWN.sh[318]: [83B blob data]
[    5.632598] (sd-transfer)[319]: Calling: /usr/lib/systemd/systemd-import raw --class confext - importtest
[    5.637769] systemd-importd[302]: (transfer1) Importing '/var/tmp/importtest', saving as 'importtest'.
[    5.637947] TEST-13-NSPAWN.sh[318]: [82B blob data]
[    5.638313] TEST-13-NSPAWN.sh[318]: [75B blob data]
[    5.638151] systemd-importd[302]: (transfer1) Operating on image directory '/var/lib/confexts'.
[    5.638863] systemd-importd[302]: (transfer1) Imported 40%.
[    5.638882] systemd-importd[302]: (transfer1) Wrote 40K.
[    5.639653] TEST-13-NSPAWN.sh[318]: [39B blob data]
[    5.639653] TEST-13-NSPAWN.sh[318]: [36B blob data]
[    5.639653] TEST-13-NSPAWN.sh[318]: [59B blob data]
[    5.639653] TEST-13-NSPAWN.sh[318]: [34B blob data]
[    5.638894] systemd-importd[302]: (transfer1) Operation completed successfully.
[    5.640760] TEST-13-NSPAWN.sh[318]: [25B blob data]
[    5.638902] systemd-importd[302]: (transfer1) Exiting.
```
The blob data entries are something like the following:
```
[    5.628796] TEST-13-NSPAWN.sh[299]: + importctl import-raw --class=confext /var/tmp/importtest
[    5.632350] systemd-importd[302]: Successfully forked off '(sd-transfer)' as PID 319.
[    5.633671] TEST-13-NSPAWN.sh[318]: ^M           ^MEnqueued transfer job 1. Press C-c to continue download in background.
[    5.632598] (sd-transfer)[319]: Calling: /usr/lib/systemd/systemd-import raw --class confext - importtest
[    5.637769] systemd-importd[302]: (transfer1) Importing '/var/tmp/importtest', saving as 'importtest'.
[    5.637947] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MImporting '/var/tmp/importtest', saving as 'importtest'.
[    5.638313] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MOperating on image directory '/var/lib/confexts'.
[    5.638151] systemd-importd[302]: (transfer1) Operating on image directory '/var/lib/confexts'.
[    5.638863] systemd-importd[302]: (transfer1) Imported 40%.
[    5.638882] systemd-importd[302]: (transfer1) Wrote 40K.
[    5.639653] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MImported 40%.
[    5.639653] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MWrote 40K.
[    5.639653] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MOperation completed successfully.
[    5.639653] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^M           ^MExiting.
[    5.638894] systemd-importd[302]: (transfer1) Operation completed successfully.
[    5.640760] TEST-13-NSPAWN.sh[318]: ^MTotal:   0%^MTotal:  40%
[    5.638902] systemd-importd[302]: (transfer1) Exiting.
```

Fixes #38552.

2 months agocore/execute: add one more FIXME comment
Yu Watanabe [Wed, 13 Aug 2025 02:29:36 +0000 (11:29 +0900)] 
core/execute: add one more FIXME comment

2 months agocore: do not touch tty when StandardOutput=/StandardError=journal+console/kmsg+console
Yu Watanabe [Tue, 12 Aug 2025 07:54:59 +0000 (16:54 +0900)] 
core: do not touch tty when StandardOutput=/StandardError=journal+console/kmsg+console

2 months agocore: make is_terminal_input() and friends inline
Yu Watanabe [Tue, 12 Aug 2025 07:21:48 +0000 (16:21 +0900)] 
core: make is_terminal_input() and friends inline

Then, rename them to exec_input_is_terminal() and so on.

2 months agocore: do not print OSC sequence on reverting TTY settings when running on a dumb...
Yu Watanabe [Mon, 11 Aug 2025 08:21:38 +0000 (17:21 +0900)] 
core: do not print OSC sequence on reverting TTY settings when running on a dumb terminal

Like we do in prepare_terminal() in exec-invoke.c.

2 months agonspawn: always set TERM=dumb when running with a pipe
Yu Watanabe [Mon, 11 Aug 2025 07:35:02 +0000 (16:35 +0900)] 
nspawn: always set TERM=dumb when running with a pipe

Otherwise, we will get unexpected OSC sequences.

2 months agoprofile: do not prompt OSC sequences when running on a dumb terminal
Yu Watanabe [Mon, 11 Aug 2025 07:41:29 +0000 (16:41 +0900)] 
profile: do not prompt OSC sequences when running on a dumb terminal

2 months agomachinectl: set TERM=dumb when running on a dumb terminal or with a pipe
Yu Watanabe [Mon, 11 Aug 2025 06:58:31 +0000 (15:58 +0900)] 
machinectl: set TERM=dumb when running on a dumb terminal or with a pipe

Fixes #38527.

2 months agodetect-virt: bare-metal GCE only for x86 and i386
keentux [Wed, 13 Aug 2025 07:52:12 +0000 (09:52 +0200)] 
detect-virt: bare-metal GCE only for x86 and i386

From the previous changes, bare-metal support has been added by using
the `detect_vm_cpuid()` which works only for x86_64 and i386 architecture.
Do not use this change for other architectures to avoid wrong result of
the detect-virt tool.

Follow-up for fb71571d3a4efddeb44f02939304be9007301974.
Fixes #38125.

2 months agobootctl: specify that kernel image commands require a kernel image argument
Antonio Alvarez Feijoo [Wed, 13 Aug 2025 09:15:33 +0000 (11:15 +0200)] 
bootctl: specify that kernel image commands require a kernel image argument

2 months agoTEST-17-UDEV: rotate journal before checking
Yu Watanabe [Wed, 13 Aug 2025 03:03:03 +0000 (12:03 +0900)] 
TEST-17-UDEV: rotate journal before checking

Otherwise, journal files may be rotated during checking journal entries
and the main system journal file may not be loaded:
```
[  350.372652] TEST-17-UDEV.sh[5841]: + test b253:2 = b253:2
[  350.373288] TEST-17-UDEV.sh[5841]: + [[ 1 == \1 ]]
[  350.373722] TEST-17-UDEV.sh[5841]: + journalctl -n 1 -q -u systemd-udevd.service --invocation=0 --grep 'Found inotify watch .*457'
[  350.374534] TEST-17-UDEV.sh[5970]: Journal file /run/log/journal/edc1fb58daff00ad89d6c8d9689bf172/system.journal is truncated, ignoring file.
[  350.375415] TEST-17-UDEV.sh[415]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-17-UDEV.watch.sh failed'
```

Fixes #38559.

2 months agoTEST-38-FREEZER: use 'systemctl show' to get freezer state 38553/head
Yu Watanabe [Wed, 13 Aug 2025 03:30:25 +0000 (12:30 +0900)] 
TEST-38-FREEZER: use 'systemctl show' to get freezer state

Also, use timeout command for waiting freezer state applied.

2 months agoTEST-38-FREEZER: check if watchdog is not restarted by systemctl daemon-reload or...
Yu Watanabe [Tue, 12 Aug 2025 06:44:02 +0000 (15:44 +0900)] 
TEST-38-FREEZER: check if watchdog is not restarted by systemctl daemon-reload or daemon-reexec

2 months agocore/cgroup: allow to set cgroup path for frozen unit
Yu Watanabe [Wed, 13 Aug 2025 01:38:53 +0000 (10:38 +0900)] 
core/cgroup: allow to set cgroup path for frozen unit

Otherwise, after 'systemctl daemon-reload' or 'daemon-reexec', frozen
units cannot gain cgroup paths and we cannot operate anything on them,
especially, we cannot thaw or stop them.
```
Aug 12 16:26:09 systemd[1]: wd.service: Job 1278 wd.service/stop finished, result=frozen
Aug 12 16:26:09 systemd[1]: Cannot stop frozen unit wd.service.
Aug 12 16:26:09 systemd[1]: wd.service: Cannot realize cgroup for frozen unit.
Aug 12 16:26:09 systemd[1]: Failed to realize cgroups for queued unit wd.service, ignoring: Device or resource busy
```

Follow-up for 23ac08115af83e3a0a937fa207fc52511aba2ffa.

2 months agocore/service: do not start watchdog on frozen unit when service manager is reloaded...
Yu Watanabe [Tue, 12 Aug 2025 06:35:21 +0000 (15:35 +0900)] 
core/service: do not start watchdog on frozen unit when service manager is reloaded or reexecuted

Otherwise, when service manager is reloaded or reexecuted, watchdong
will be started for frozen services, and they may be killed after
timeout.

Fixes #38551.

2 months agotest-cgroup: cleanup test cgroup
Luca Boccassi [Tue, 12 Aug 2025 22:59:15 +0000 (23:59 +0100)] 
test-cgroup: cleanup test cgroup

One test cgroup gets left behind by the test, as it moves itself
into it. Move itself and back to the original cgroup at the end
and clean up.

This fixes a failure when running the test first as root, and then
as unprivileged (initial cleanup fails as the leftover test cgroup
is owned by root).

2 months agoCI: run ruff format before ruff check
Luca Boccassi [Tue, 12 Aug 2025 22:40:11 +0000 (23:40 +0100)] 
CI: run ruff format before ruff check

Otherwise you get a failure but no hint on how to fix it

2 months agotpm2-util: fixlets for tpm2_serialize/_deserialize() (#38520)
Luca Boccassi [Tue, 12 Aug 2025 18:54:44 +0000 (19:54 +0100)] 
tpm2-util: fixlets for tpm2_serialize/_deserialize() (#38520)

Fixes #38507.

2 months agocore: suppress warning
Matteo Croce [Tue, 12 Aug 2025 16:53:59 +0000 (18:53 +0200)] 
core: suppress warning

Avoid definition of `exec_context_get_tty_for_pam` if pam support is
disabled, to avoid the following warning:
```
../src/core/exec-invoke.c:1231:12: warning: ‘exec_context_get_tty_for_pam’ defined but not used [-Wunused-function]
 1231 | static int exec_context_get_tty_for_pam(const ExecContext *context, char **ret) {
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

2 months agotpm2-util: copy serialized result in tpm2_serialize() 38520/head
Yu Watanabe [Fri, 8 Aug 2025 02:27:21 +0000 (11:27 +0900)] 
tpm2-util: copy serialized result in tpm2_serialize()

For safety, though typically Esys_Free() is just a simple wrapper of
free(), but let's do unconditionally. See the comment in the code.

While at it, this makes it store the result into struct iovec.

2 months agotpm2-util: gracefully skip deserialization when no input
Yu Watanabe [Fri, 8 Aug 2025 02:07:30 +0000 (11:07 +0900)] 
tpm2-util: gracefully skip deserialization when no input

While at it, this also makes tpm2_deserialize() take struct iovec.

Fixes #38507.

2 months agoEnable KEY_PERFORMANCE key present on Linux 6.17 (#38533)
Lennart Poettering [Mon, 11 Aug 2025 16:38:58 +0000 (18:38 +0200)] 
Enable KEY_PERFORMANCE key present on Linux 6.17 (#38533)

Linux 6.17 defines a key called KEY_PERFORMANCE for machines that have a
perfomance mode, like Alienware and Dell G-series.

2 months agopcrlock: make-policy should use path specified by --policy= rather than --pcrlock
Yu Watanabe [Fri, 8 Aug 2025 04:09:14 +0000 (13:09 +0900)] 
pcrlock: make-policy should use path specified by --policy= rather than --pcrlock

Follow-up for a43427013949c6593629f551cf46e9cf9c167100.
Fixes #38506.

2 months agoEnable KEY_PERFORMANCE key present on Linux 6.17 38533/head
Marcos Alano [Sat, 9 Aug 2025 10:52:27 +0000 (07:52 -0300)] 
Enable KEY_PERFORMANCE key present on Linux 6.17

Note, this change does not require the kernel running on the host is
equal or newer than 6.17. But systemd-udevd needs to be built with the
kernel headers with KEY_PERFORMANCE, and the relevant kernel header is
already updated by the previous commit.

2 months agoinclude: update kernel headers from v6.17-rc1
Yu Watanabe [Mon, 11 Aug 2025 13:20:53 +0000 (22:20 +0900)] 
include: update kernel headers from v6.17-rc1

2 months agotest: add coverage for kernel keyring in TEST-50-DISSECT
Luca Boccassi [Fri, 8 Aug 2025 21:59:45 +0000 (22:59 +0100)] 
test: add coverage for kernel keyring in TEST-50-DISSECT

Use the kernel keyring to verify images in the dissect test.
The userspace keyring is still covered by the DDI and mountfsd tests.

2 months agochid: don't hardcode magic numbers for non-official CHIDs
Tobias Heider [Sun, 10 Aug 2025 14:27:46 +0000 (16:27 +0200)] 
chid: don't hardcode magic numbers for non-official CHIDs

They are constructed from EXTRA_CHID_BASE + offset

2 months agoMissing man page and fixes for man page links (#38540)
Zbigniew Jędrzejewski-Szmek [Mon, 11 Aug 2025 08:53:45 +0000 (10:53 +0200)] 
Missing man page and fixes for man page links (#38540)

2 months agoman: fix links 38540/head
Zbigniew Jędrzejewski-Szmek [Sun, 10 Aug 2025 11:38:44 +0000 (13:38 +0200)] 
man: fix links

Found using linkchecker.
For virtiofsd, the man page is maintained upstream, but doesn't seem to be
available in any of the usual places. So let's link to the Debian version.
systemd.filter I have no idea what it is.

2 months agocore/exec-invoke: fallback to set TTY specified by TTYPath= to PAM
Yu Watanabe [Fri, 8 Aug 2025 06:02:01 +0000 (15:02 +0900)] 
core/exec-invoke: fallback to set TTY specified by TTYPath= to PAM

Follow-up for 2b0087e5b171e2292c07bacef8908bf4d5339a4b.
Fixes #38486.

2 months agoservice: stop/reset watchdog on freeze/thaw
Luca Boccassi [Fri, 8 Aug 2025 19:08:20 +0000 (20:08 +0100)] 
service: stop/reset watchdog on freeze/thaw

Otherwise the unit will be killed by the watchdog given it's frozen
but the clock keeps ticking

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

2 months agoci: add mkosi job for debian stable
Luca Boccassi [Sat, 9 Aug 2025 14:09:35 +0000 (15:09 +0100)] 
ci: add mkosi job for debian stable

Debian 13 has just been released and can build and run everything,
so add CI coverage for it

2 months agohwdb: Add launch emoji keyboard mapping for Asus M1607KA
Vasiliy Kovalev [Sun, 10 Aug 2025 07:24:19 +0000 (10:24 +0300)] 
hwdb: Add launch emoji keyboard mapping for Asus M1607KA

By default, pressing Fn+F8 maps the scancode to KEY_BLUETOOTH (in evtest,
MSC_SCAN 7e -> KEY_BLUETOOTH). Windows/the manufacturer may intercept the
same scancode to execute "Launch Emoji keyboard."
On Linux, we get the "raw" KEY_BLUETOOTH code, which is unacceptable.

prog1 is already reserved by default for launching MyAsus (a Windows
application) with the Fn+F12 combination, so we will use prog2.

Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
2 months agoman: add sd-path page
Zbigniew Jędrzejewski-Szmek [Sun, 10 Aug 2025 11:20:01 +0000 (13:20 +0200)] 
man: add sd-path page

We have similar pages for other parts of libsystemd too.

2 months agopo: Translated using Weblate (Khmer (Central))
kanitha chim [Sat, 9 Aug 2025 11:53:39 +0000 (11:53 +0000)] 
po: Translated using Weblate (Khmer (Central))

Currently translated at 16.2% (43 of 264 strings)

Co-authored-by: kanitha chim <kchim@redhat.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/km/
Translation: systemd/main

2 months agoudev-rules: add missing device name prefix in log message
Yu Watanabe [Sat, 9 Aug 2025 00:07:35 +0000 (09:07 +0900)] 
udev-rules: add missing device name prefix in log message

Otherwise, it is hard to find the dump in journal. With this change,
we can find the entry by e.g.
journalctl -b -u systemd-udevd.service DEVICE=eth0

Follow-up for b4ffb776696bdd3a7345f73956ce7551f6b449ff.

2 months agoci: stop triggering suse-specific package build on OBS
Luca Boccassi [Fri, 8 Aug 2025 17:46:07 +0000 (18:46 +0100)] 
ci: stop triggering suse-specific package build on OBS

Packages are now unified as the fedora spec can cohexist with suse's

3 months agonetwork: fix segfault in setting bridge vlan (#38519)
Luca Boccassi [Fri, 8 Aug 2025 14:04:33 +0000 (15:04 +0100)] 
network: fix segfault in setting bridge vlan (#38519)

3 months agonetwork/bridge-vlan: fix segfault 38519/head
Yu Watanabe [Fri, 8 Aug 2025 10:39:28 +0000 (19:39 +0900)] 
network/bridge-vlan: fix segfault

Fixes a bug introduced by 78738adf88ad288a6af37a1998adc749ac6b5f2d.
Fixes #38515.