Commit Graph
83406 Commits
Author SHA1 Message Date
Yu Watanabe f78a482393 udev: fix typo
Follow-up for 32333754ae.
2025-08-26 04:49:03 +09:00
Jan Fooken 7bb8e9e82f tmpfiles: don't relabel files in dry run mode
tmpfiles attempts to correct the label of a file during various actions
via the function fd_set_perms().  Currently, said function generally
respects the dry-run mode.  However, it attempts to fix the label of a
given file regardless of the state of said dry-run mode.

This causes problems, because a user could attempt to run tmpfiles with
elevated permissions and dry run enabled, expecting the tool to not
modify their system.  Instead, tmpfiles would falsely relabel a file,
modifying their system.

This commit explicitly checks for when dry-run is enabled and skips the
file relabelling process.  Furthermore, I added logging for both cases.
I found helpful during debugging.  That said, I don't think it's
necessary to use the level LOG_INFO on the dry-run path, as it would
always produce an info log.
2025-08-26 04:07:24 +09:00
Luca Boccassi 9ce6d08196 import-generator: fix crash with no remote string in systemd.pull=
SYSTEMD_PROC_CMDLINE=rd.systemd.pull=raw,machine,blockdev,bootorigin:rootdisk systemd-import-generator

Follow-up for 0c892214f7
2025-08-25 19:08:25 +01:00
Lennart Poettering ce3b12713b nspawn: the second time on_orderly_shutdown() is called userdata is NULL (#38709)
We know that it is, because we set it to NULL in the very same
on_orderly_shutdown() call.
2025-08-25 19:08:01 +01:00
Luca Boccassi 8f6236164c boot: also remember auto-generated entries
Windows/OSX/shell/etc entries are autogenerated, and should be remembered too
as the previous choice, together with Linux ones.

Follow-up for d870ae47b7

Fixes https://github.com/systemd/systemd/issues/38694
2025-08-25 23:45:12 +09:00
AsciiWolf e8628ddb78 hwdb: sort SDR devices by vendor name 2025-08-25 13:42:09 +01:00
Yu Watanabe 64fc4917b9 core/unit: use UNIT_FOREACH_DEPENDENCY_SAFE() at several more places
manager_add_job() -> transaction_add_job_and_dependencies() may update
dependencies when a unit is not loaded yet. Hence, we need to restart
dependency loop in that case.

Follow-up for b7777d0884 (#37465).
Fixes #38676.
2025-08-25 13:41:23 +01:00
Felix Pehla ddc9d2a836 systemd-boot: don't always log NX_COMPAT info
Commit 70b7e03 introduced 3 calls to log_debug() about the presence or
absence of NX_COMPAT support. Since sd-boot does not yet have the
ability to only print messages above a certain loglevel, these will
always be printed, even on top of the configured splash screen. This
commit removes the log_debug() call after a success and only prints
those for missing firmware support if the UEFI should support them in
the first place (i.e. starting with version 2.10).
2025-08-25 13:40:54 +01:00
Jack Wu 46a688c559 hwdb: enable autosuspend for Dell DW5826e WWAN modem 2025-08-22 23:38:08 +01:00
Luca Boccassi a4f9ddbbe7 TEST-46-HOMED: improve stability of the test (#38659)
Fixes #38643.
2025-08-22 23:37:52 +01:00
Jesse Guo 88fb777619 po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Jesse Guo <jesseguotech@outlook.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
2025-08-22 12:11:11 +01:00
Yu Watanabe aed28d0c57 TEST-46-HOMED: homectl unregister and friends needs the target is inactive or absent
Hence, we need to wait for the previous operation finished.
Fixes the following failure:
```
TEST-46-HOMED.sh[107]: + homectl unregister signtest
TEST-46-HOMED.sh[1449]: Failed to unregister home: Home signtest is currently being used, or an operation on home signtest is currently being executed.
```

Fixes #38643
2025-08-22 02:28:58 +09:00
Yu Watanabe 5fb7b67556 TEST-46-HOMED: cleanup homedsshtest earlier 2025-08-22 01:11:35 +09:00
Lennart Poettering a6d25ebc25 update TODO 2025-08-21 11:44:57 +02:00
Yu Watanabe dd712ba9c4 homed: do not print sensitive data when debug logging is enabled 2025-08-21 18:15:44 +09:00
Christopher Head bd254d371b Add Razer Cobra mouse to hwdb
The DPI values are based on the product’s printed documentation. The
frequency values are based on the endpoint descriptor reported by lsusb
(the mouse is a full-speed USB device and bInterval is 1 at all DPI
settings). Both sets of values are for a mouse that has *not* been
touched by the vendor’s configuration tool.
2025-08-21 10:15:38 +01:00
Luca Boccassi 65f3e8dfd2 meson: update version numbers for v258~rc3 2025-08-20 15:16:42 +01:00
Luca Boccassi a801a6d061 Chores for RC3 (#38653) 2025-08-20 15:16:03 +01:00
Luca Boccassi 49e69a59ca NEWS: update date 2025-08-20 13:19:51 +01:00
Luca Boccassi ad315bb102 NEWS: update contributors list 2025-08-20 13:19:51 +01:00
Luca Boccassi 27a1e162a1 Update syscalls tables
ninja -C build update-syscall-tables update-syscall-header
2025-08-20 13:19:51 +01:00
Luca Boccassi 26f971909e hwdb: update autosuspend rules
ninja -C build update-hwdb-autosuspend
2025-08-20 13:09:13 +01:00
Luca Boccassi 9b3dceba64 hwdb: update rules
ninja -C build update-hwdb
2025-08-20 13:09:13 +01:00
Luca Boccassi e9caf17f63 Revert "resolved: don't wait for TLS close_notify replies unnecessarily"
This change introduced a regression that stops DNSOverTLS from working
after some time. Revert it for now, as there's no fixup available at
the moment.

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

This reverts commit 4b6dbd4ea5.
2025-08-20 14:04:27 +02:00
Zbigniew Jędrzejewski-Szmek 39a8eb9e32 chase: trigger autofs only when explicitly requested (#38641)
Replaces #38569.
Fixes #38565.
2025-08-20 14:02:45 +02:00
Zbigniew Jędrzejewski-Szmek eddc4b5a42 NEWS: reword notice about planned req version bumps 2025-08-20 13:41:07 +02:00
Michal Sekletar fb56da5b6e coredump: drop RestrictSUIDSGID= option (#38640)
systemd-coredump sandbox already has ProtectSystem=strict hence all non
API filesystems are made read-only, thus RestrictSUIDSGID= doesn't buy
us much.

On top of that systemd-coredump's EnterNamespace= feature requires
openat2() to work correctly and that is implicitly blocked by
RestrictSUIDSGID=.

Follow-up for 8f8148cb08
2025-08-20 11:42:30 +01:00
Yu Watanabe 88fce09026 nspawn: fix --link-journal=host with --private-users=pick and friends
Fixes #38611.
2025-08-20 16:17:59 +09:00
Yu Watanabe 045227426e test: fix typo 2025-08-20 16:17:11 +09:00
Yu Watanabe fd8c620751 NEWS: announce bump of required minimum version of several components in next release
Distro            EOL     kernel  glibc meson  python  openssl cryptsetup util-linux elfutils libxcrypt libfido2 libseccomp
Ubuntu 24.04 LTS  2029-06 6.8     2.39  1.3.2  3.12.3  3.0.13  2.7.0      2.39.3     0.190    4.4.36    1.14.0   2.5.5
Ubuntu 25.04      2026-01 6.14    2.41  1.7.0  3.13.3  3.4.1   2.7.5      2.40.2     0.192    4.4.38    1.15.0   2.5.5
Ubuntu 25.10      2026-07 6.16    2.41  1.7.0  3.13.5  3.5.0   2.8.0      2.41       0.193    4.4.38    1.16.0   2.6.0
CentOS 9          2027-05 5.14.0  2.34  0.63.3 3.9.23  3.5.1   2.7.2      2.37.4     0.193    4.4.18    1.13.0   2.5.2
CentOS 10         2030-01 6.12.0  2.39  1.4.1  3.12.11 3.5.1   2.7.5      2.40.2     0.193    4.4.36    1.14.0   2.5.6
Debian 12         2026-06 6.12.38 2.36  1.7.0  3.11.2  3.0.17  2.6.1      2.38.1     0.192    4.4.33    1.12.0   2.5.4
Debian 13         2028-08 6.12.41 2.41  1.7.0  3.13.5  3.5.1   2.7.5      2.41       0.192    4.4.38    1.15.0   2.6.0

kernel releases: https://en.wikipedia.org/wiki/Linux_kernel_version_history
glibc releases: https://en.wikipedia.org/wiki/Glibc
python releases: https://en.wikipedia.org/wiki/History_of_Python
openssl releases: https://en.wikipedia.org/wiki/OpenSSL

See also #38608.
2025-08-20 06:00:49 +09:00
Yu WatanabeandLuca Boccassi 4279336618 chase: trigger automount only when explicitly requested
Since c5de7b14ae
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 c5de7b14ae.
Fixes #38565.
Replaces #38569.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
2025-08-20 02:32:02 +09:00
Yu Watanabe 9dcd034085 chase: introduce CHASE_NO_SHORTCUT_MASK 2025-08-20 02:24:39 +09:00
Yu Watanabe 2e7d7e929e Revert "chase: invert CHASE_NO_AUTOFS and only set it where needed"
This reverts commit 490aa05ca1.

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.
2025-08-20 02:15:36 +09:00
Luca Boccassi 1441f2e992 Add padding to sbat section (#38621) 2025-08-19 17:49:07 +01:00
Luca Boccassi 70b7e03ebb 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 cab9c7b5a4

Fixes https://github.com/systemd/systemd/issues/38545
2025-08-19 17:16:57 +02:00
Luca Boccassi 490aa05ca1 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
2025-08-19 16:48:13 +02:00
Alexander Bruy b15ff659b4 hwdb: map FN key on TongFang X4SP4NAL laptops 2025-08-19 13:05:56 +01:00
Luca Boccassi b1cd38e893 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
2025-08-19 12:32:00 +01:00
Lennart Poettering 265386ba35 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.
2025-08-19 11:49:19 +01:00
Lennart Poettering de9e6428b5 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: 0261fe571b
2025-08-19 11:48:14 +01:00
Lennart Poettering a294cc182d 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.
2025-08-19 11:47:49 +01:00
Zbigniew Jędrzejewski-Szmek ee45041da1 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
c3f7501c4d, 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.
2025-08-19 11:50:28 +02:00
Zbigniew Jędrzejewski-Szmek b4a1854397 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.
2025-08-19 11:50:27 +02:00
Zbigniew Jędrzejewski-Szmek ec1d031f3d 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.
2025-08-19 11:08:35 +02:00
Zbigniew Jędrzejewski-Szmek 2ddbbb22db ukify: adjust comments 2025-08-19 10:46:36 +02:00
Zbigniew Jędrzejewski-Szmek dbd7b16819 ukify: extend error message when section is too small 2025-08-19 10:46:36 +02:00
Américo Monteiro 16758c2650 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
2025-08-19 17:20:42 +09:00
Fco. Javier F. Serrador e5487d1742 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
2025-08-19 17:20:42 +09:00
Li Tian 776991a3f3 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
2025-08-18 22:43:41 +01:00
Lennart Poettering c24f405ace 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: fd51a7d8b5
2025-08-18 21:50:55 +09:00