Commit Graph
85865 Commits
Author SHA1 Message Date
Kai Lueke 2ab3a2b44c sysext: Use correct image name for extension release checks
For the extension release check the image name is needed and was derived
from the backing file of the loop device. However, this can have a
different name when symlinks were resolved. The surprising behavior was
that it worked when the target name started with the extension name and
_ because that's what's supported to chop off version suffixes. However,
we should not have such strict requirements for the target name and also
allow - as version separator and entirely different names/prefixes, the
same way as we also do for directories instead of raw images.

Do not use the image name derived from the backing file of the loop
device but directly the extension name we have at hand.
2026-01-28 12:24:57 +01:00
Kai Lueke 5c6bb28999 discover-image: Follow symlinks in a given root
So far systemd-sysext with --root= specified didn't follow extension
symlinks (such as the "current" symlinks managed by systemd-sysupdate).
The main use case is running systemd-sysext --root=/sysroot for setting
up the overlay mounts already from the initrd.

Resolve symlinks correctly but don't defend against later symlink races
that would access a path outside of the given root. Malicous live
modifications are not a realistic threat model and anyway for that one
would need to rework how the image entry is passed over up to the point
when the loop device is set up. This change here does not introduce this
weakness nor does it expose it more than before. Thus, make it explicit
that setting up the extensions for a given --root= implies a certain
trust into this given root tree that it does not try do race conditions
with symlinks to trick systemd-sysext to mount a file outside --root=.
Without a strict --image-policy= set we would anyway mount filesystems
right away which is another attack vector but, again, the main use case
is to do this for the final system which is trusted at this stage.
2026-01-28 12:24:57 +01:00
Mike Yuan a8b099d663 sd-event: unpoison memory returned by epoll_pwait2() (#40464)
Fixes #40455

Alternative to #40463
Closes #40463
2026-01-25 00:50:18 +01:00
Lennart Poettering 3775fab341 CODING_STYLE: suggest a clear order for func params that combine fd and path 2026-01-24 20:52:00 +01:00
Lennart Poettering ca088266bc loop-util: when open_flags is unspecified derive it from passed in fd 2026-01-24 20:51:45 +01:00
Mike Yuan cc94dca5bc sd-event: use FOREACH_ARRAY 2026-01-24 18:51:21 +01:00
Mike Yuan 21ebcb5814 sd-event: unpoison memory returned by epoll_pwait2()
Our fuzzer CI recently got bumped to Ubuntu 24.04 with
glibc >= 2.35. Apparently msan is not happy with the new
epoll_pwait2(), hence explicitly mark the memory region
as initialized.

Fixes #40455
Alternative to #40463
2026-01-24 18:36:24 +01:00
Mike Yuan 1b2ad38b2b README: add epoll_pwait2() to the list of kernel APIs 2026-01-24 18:28:24 +01:00
Mike Yuan 5ad66a9b72 units/meson.build: rebreak lines 2026-01-24 18:07:15 +01:00
Luca Boccassi c644e9e6e6 mkosi: fix debian/ubuntu/suse builds
Follow-up for 072e72424b
2026-01-24 16:12:09 +01:00
Luca Boccassi c4fd3043ff mkosi: workaround autovt removal in SUSE spec
Follow-up for 072e72424b
2026-01-24 13:24:58 +00:00
Luca Boccassi acd5fd0a6d mkosi: update debian commit reference to 6f4d90be5cb4075954f0a36653105e586a9a1fa9
* 6f4d90be5c Do not install autovt@ for upstream builds
* 8cc28a6b82 Install new files for upstream build
* 0d15255073 Use deb-systemd-invoke to reexec instead of manual calls
* db04e5fa0b Use dh_installsystemd to handle journald and networkd
* d8756a4c82 Use dh_installsystemd more to manage units
* 40b23b0d5d d/tests: drop tests-in-lxd
* 5821c5a350 d/control: have systemd-boot depend on efibootmgr for amd64 and arm64 only

Follow-up for 072e72424b
2026-01-24 13:19:56 +00:00
Zbigniew Jędrzejewski-Szmek 072e72424b units/getty@.service: use [Install]Alias= instead of static alias
In Fedora, kmsconvt@.service is starting to be used instead of getty@.service
to have nicer font handling. This means that we need the autovt@.service alias
point to the new unit. So far the alias was done through a static symlink
because there was little reason to change it. Let's use [Install] instead so
the decision which implementation to use can be made after installation.

https://bugzilla.redhat.com/show_bug.cgi?id=2429626
https://fedoraproject.org/wiki/Changes/UseKmsconVTConsole
2026-01-24 13:19:08 +01:00
Lennart Poettering a2bf4b5da9 tivial journal fixlets (#40448) 2026-01-24 13:18:31 +01:00
Lennart Poettering c5761f352b mountfsd: improve logging 2026-01-24 13:18:15 +01:00
Mike Yuan 0f22a0918d run: remove unused enum values for getopt_long() 2026-01-24 13:18:00 +01:00
Mike Yuan afc5d175a2 core/exec-invoke: switch PRIVATE_USERS_FULL to direct "0 0 UINT32_MAX" mapping (#40445) 2026-01-24 00:04:30 +01:00
Lennart Poettering 1efc263433 journal: do not use typecasts for range checks 2026-01-23 22:51:29 +01:00
Lennart Poettering 3f74a81f65 journal: some whitespace fixes 2026-01-23 22:51:29 +01:00
Lennart Poettering 89e94f6369 update TODO 2026-01-23 22:19:18 +01:00
Mike Yuan 24c73c7920 core/exec-invoke: switch PRIVATE_USERS_FULL to direct "0 0 UINT32_MAX" mapping
This was intended for v259. Let's get it done now, in v260.
2026-01-23 19:29:48 +01:00
Mike Yuan 6ed05d6414 core/exec-invoke: group setup_private_users*() together 2026-01-23 18:48:31 +01:00
Mike Yuan cf54b1ea57 pam_systemd: remove handling of obsolete "existing" attr from CreateSession() call (#40432) 2026-01-23 17:50:44 +01:00
Derek J. Clark a68c8d9ac2 hwdb: Update Lenovo Legion Go Models
- Different BIOS versions of the Legion Go 2 can init the keyboard
  device as set 1 (appears as raw set 2) or as set 2 (appears as
  translated set 2). Add the Legion Go 2 to the Translated list.
- While at it, specify the models in a more verbose manner for
  posterity.

Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
2026-01-24 00:46:19 +09:00
Peter Oliver af718e0535 ansi-color: new option SYSTEMD_COLORS=auto-16/auto-256/auto-24bit (#40303)
Setting SYSTEMD_COLORS=auto-16 is like SYSTEMD_COLORS=16 if output is to
a non-dumb TTY, and like SYSTEMD_COLORS=no otherwise.

Relates to
https://github.com/systemd/systemd/issues/15498#issuecomment-1682025186
2026-01-23 13:54:31 +01:00
Lennart Poettering fa41ce1142 hostnamed: after unescaping fancy name, validate it's valid UTF-8
The fancy name could contain arbitrary bytes, in escaped fashion. Before
using it, let's validate that this contains only valid UTF-8.

(Note that D-Bus might kick us off the bus if we don't ensure everything
we send around is UTF-8).

(While we are at it, do the same in PID 1, even though it's not that
important there)

Addresses this issue found by @YHNdnzj:

https://github.com/systemd/systemd/pull/40367#discussion_r2714614301

Follow-up for: #40367
2026-01-23 13:35:43 +01:00
Antonio Alvarez Feijoo 236033fd48 man/fstab-generator: correct root= options
Remove duplicate "fstab" option, and add missing "tmpfs" and "bind:" options.
2026-01-23 13:29:31 +01:00
Mike Yuan 2a2b5f8091 pam_systemd: remove handling of obsolete "existing" attr from CreateSession() call
Follow-up for b80120c4cb

After the mentioned commit, logind returns an error if the process
already lives in a session, and register_session() short-circuits
without setting systemd.existing flag. Hence systemd.existing
is either false or unset for pam_sm_close_session(), making
the whole logic effectively NOP. Kill it with fire.
2026-01-22 20:49:38 +01:00
Mike Yuan 5d2e9c2ad0 hostnamed: use INDEXES_TO_MASK where appropriate
Addresses https://github.com/systemd/systemd/pull/40367#discussion_r2714368627
2026-01-22 20:49:38 +01:00
Franck Bui 49f7149947 pam_systemd: fix regression introduced in v258 by preserving the FIFO fd
Upstream commit 3180c4d introduced a version incompatibility between
pam_systemd.so v258 and logind v257. This is problematic because such version
mismatches can occur in practice: logind still cannot be restarted during a
systemd package upgrade (it's a long-standing limitation, see
https://github.com/systemd/systemd/issues/17308).

When pam_systemd requests a new session, logind v257 returns a FIFO
fd. pam_systemd.so v258 ignores this fd and closes it. logind interprets the
closure as the session leader exiting and immediately terminates the session.

This patch partially reverts commit 3180c4d and restores the handling of the
FIFO fd in pam_systemd. The change is limited to the D-Bus APIs, since the
varlink API was only introduced in logind v258.

Follow-up for 3180c4d461.
2026-01-22 19:13:13 +01:00
Daan De Meyer b61aeeb315 meson: Drop minimum meson version required for clang-tidy 2026-01-22 13:33:35 +09:00
Lennart Poettering 0910cb9324 os-release: add a new FANCY_NAME= field to /etc/os-release, similar to PRETTY_NAME, that may carry ansi sequences + more unicode chars (#40367)
It's sometimes useful include non-ascii unicode chars in an os name, and
give it some ansi coloring. Since we usualy don't want to show that,
introduce a new field for it, and show it at boot and in thostnamectl
only, with safe fallbacks if colors/emojis are not available.
2026-01-21 23:57:39 +01:00
Mike Yuan e9a1271a0c units/systemd-portabled: enable NoNewPrivileges=
As with all other daemons we ship.
2026-01-21 23:13:09 +01:00
Daan De Meyer a08cee5084 mountfsd: Make singleFileSystem non-nullable
It's always set, so no need to be nullable.
2026-01-21 23:12:47 +01:00
Lennart Poettering 1dab8472e0 hostnamectl: show fancy name if available 2026-01-21 21:32:49 +01:00
Lennart Poettering 955446d2e4 hostnamed: expose fancy OS name as a field 2026-01-21 21:32:49 +01:00
Lennart Poettering d6749f35ae pid1: show fancy name field at boot, if specified 2026-01-21 21:32:49 +01:00
Lennart Poettering a01cd5bed3 man: introduce FANCY_NAME field 2026-01-21 21:32:49 +01:00
Lennart Poettering f42dc5ea18 format-table: add new string cell type that accepts ANSI sequences
For various usecases it's useful that we can embed ANSI sequences in
cells of tables. For example, I hope we can eventually switch "systemctl
status" output to use the table formatter, and multiple of its fields
contain ANSI sequences (since they pack multiple different pieces
information into the same field, and highlight parts of it to
communicate relevance of distinct parts).

Add a distinct cell type for this, which gets special processing when we
output to a terminal that doesn't support ANSI sequences, and to JSON:
we strip the sequences.
2026-01-21 21:32:49 +01:00
Mike Yuan adcc87f802 Trivial follow-ups for recently merged PRs (#40417) 2026-01-21 19:54:32 +01:00
Daan De Meyer b58a45e96a portable: Enable unpriv operation (#40091)
This does not yet support directory images properly
as systemd itself does not support unpriv directory
images properly yet.
2026-01-21 16:46:53 +01:00
Mike Yuan 13c0351ba4 fdset: do not call fd_get_path() if debug logging is off
Follow-up for 89065ada83
2026-01-21 15:55:06 +01:00
Yu Watanabe 68c7004236 network/dhcp4: send release message before stopping the client
Otherwise, the socket is already closed and sending release will be
anyway skipped.

With this patch, release message is sent before stopping the client.
```
Jan 20 18:29:41 systemd[1]: Stopping systemd-networkd.service - Network Management...
Jan 20 18:29:41 systemd-networkd[3821255]: wlp59s0: DHCPv4 client: RELEASE
Jan 20 18:29:41 systemd-networkd[3821255]: wlp59s0: DHCPv4 client: STOPPED
Jan 20 18:29:41 systemd-networkd[3821255]: wlp59s0: DHCP lease lost
```

Fixes #39299.
2026-01-21 15:50:35 +01:00
Mike Yuan 1886047e59 fdset: sort includes 2026-01-21 15:49:58 +01:00
Mike Yuan 382382a6eb sysupdate-resource: on hash mismatch the best before marker is not ignored
Hence use a less ambiguous wording.

Follow-up for d0badc0a61
Addresses https://github.com/systemd/systemd/pull/40393#discussion_r2709953179
2026-01-21 15:48:14 +01:00
Daan De Meyer 824fcb95c9 portable: Enable unpriv operation
This does not yet support directory images properly
as systemd itself does not support unpriv directory
images properly yet.

The user profiles are a copy of the system profiles but without
DynamicUser=yes (can't be used by user managers) and without
ProtectHome=yes (this masks /home which breaks StateDirectory= which
is lcoated inside /home)
2026-01-21 15:09:46 +01:00
Vunny Sodhi db4b6b7043 pam_systemd_home: Use PAM_TEXT_INFO for token prompts
The prompts asking the user to physically authenticate
or confirm presence on a security token are informational
requests for action, not error conditions.

This commit changes the message type to PAM_TEXT_INFO,
which is more appropriate for guiding the user through
the authentication process.
2026-01-21 14:18:15 +01:00
AshishKumar Mishra 89065ada83 shared/fdset: add detailed debug logging to fdset_new_fill()
Currently, when fdset_new_fill() fails to open /proc/self/fd or
encounters an error while processing individual file descriptors
(such as fcntl or fstat failures), it returns a silent error code.

For debugging rarely reproducible failures it becomes difficult to
know the exact cause of failure
This commit updates the function to use log_debug_errno() for all
error paths and hence  provides better visibility into why FD collection
failed, including the path of the problematic FD (via fd_get_path)
and its inode type.
2026-01-21 20:11:23 +09:00
Daan De Meyer 1a239eae8e portable: Split out receive_portable_metadata() 2026-01-21 12:03:08 +01:00
Daan De Meyer e4058c584f portable: Make extract_now() operate on a dirfd
Preparation for making portabled support unpriv
operation.
2026-01-21 12:03:08 +01:00