Commit Graph
100 Commits
Author SHA1 Message Date
Lennart Poettering c25226b820 report: add metrics source that reports current disk space data 2026-09-25 16:43:13 +02:00
Lennart Poettering 186a8486fc report: add backend for reporting temperature sensors 2026-09-23 16:31:41 +02:00
Lennart Poettering 641da198fd update TODO 2026-09-23 10:14:25 +02:00
Lennart Poettering 236e7d8a4c ci: testcase for new auto-pick mode of sysinstall 2026-09-23 10:14:25 +02:00
Lennart Poettering 0bb2f138f4 sysinstall: correct end marker log message
Copypasta...
2026-09-23 10:14:25 +02:00
Lennart Poettering 9b7f2c64b1 sysinstall: send out READY=1 when we start our thing
This is useful so that whoever invokes the tool knows that the general
parameters checked out, and the tool now proceeds with actually doing
the work.
2026-09-23 10:14:25 +02:00
Lennart Poettering ce8d684ed8 sysinstall: optionally, automatically pick target block device after a settle timeout
Let's make sysinstall useful for truly unattended installations, and let
it it automatically pick a target disk after some settlement time-out.
2026-09-23 10:14:25 +02:00
Lennart Poettering 647fa40327 blockdev-list: add blockdev_list_full() which allows passing in a pre-determined pair of root_devno/whole_root_devno 2026-09-23 10:08:36 +02:00
Lennart Poettering 48a9afb6ec blockdev-list: split BLOCKDEV_LIST_IGNORE_LOOP out of BLOCKDEV_LIST_IGNORE_VIRTUAL
So far BLOCKDEV_LIST_IGNORE_VIRTUAL filtered out everything below
/sys/devices/virtual/, which includes loopback devices. Loopback devices
are frequently used as stand-ins for real disks though (in tests, and
when installing to disk images), hence it's useful to be able to control
them independently of the other virtual devices (dm, md, zram, …).

Introduce a separate BLOCKDEV_LIST_IGNORE_LOOP flag for loopback
devices, and make BLOCKDEV_LIST_IGNORE_VIRTUAL only cover the non-loop
virtual devices. The only existing user (systemd-report) is updated to
pass both flags, so that its behaviour stays unchanged.
2026-09-23 10:08:36 +02:00
Lennart Poettering b8ee13613c dissect: make --detach work when passed the backing block device of a loopback device
When systemd-loop@.service is instantiated for a block device (e.g. a
CD-ROM drive, which is the primary usecase now that --relax is used),
%f resolves to the backing block device rather than to the loopback
block device that was attached on top of it. In that case ExecStop=
hence invoked --detach on a block device that is not a loopback device
at all, which made loop_device_set_autoclear() a silent no-op, leaking
the attachment.

Hence, if --detach is passed a block device that is not a loopback
block device itself, search for the loopback block device backed by it,
the same way we already do for regular files. The kernel reports the
backing inode for block device nodes too, so the same inode matching
logic applies.
2026-09-22 16:04:26 +02:00
Lennart Poettering 6a16394cd6 units: use --relax in systemd-loop@.service
Our primary usecase for this service is to deal with sector issues
around CDROMs. For that insisting on proper DDI layout and a root
partition is overkill. Let's hence relax the logic for this.

Fixes: #43605
2026-09-22 16:04:26 +02:00
Lennart Poettering b0edc60661 dissect: optionally allow attaching images that do not qualify as DDIs with --attach
It's nice to use --attach since it validates our images. So far, it
strictly insisted on checking that the image was a DDI however, which
limits its use for certain usecases.

Add "--relax" to address this limitation.
2026-09-22 16:04:26 +02:00
Lennart Poettering 937b244237 core: extend ExecStart= varlink support for StartTransientUnit() to accept execution flags 2026-09-22 16:02:44 +02:00
Lennart Poettering 214ca71682 core: open more fields up to StartTransientUnit via Varlink 2026-09-22 16:02:44 +02:00
Lennart Poettering c64cb914ac core: add exec_output_is_file() helper
The set of file based output types is open-coded in three places (and a
fourth one is about to be added), let's define it once, next to the
other ExecInput/ExecOutput predicates.
2026-09-22 16:02:44 +02:00
Lennart Poettering 2779ecaca3 string-util: port strip_tab_ansi() to AnsiSeqParser
So far strip_tab_ansi() was very superficial: it only focussed on OSC
and CSI sequences, and left the other ANSI sequences in touch.

Let's make it more powerful and port it to the more complete
AnsiSeqParser logic, and strip *all* ANSI sequences.

For the relevant usecases this seems like the better, safer choice,
since it's good to strip too much rather than too little, when
stripping ANSI sequences.
2026-09-22 15:57:58 +02:00
Lennart Poettering b8da2dc98e basic: add simple ansi sequence parser
This tries to generalize ANSI sequence handling a bit, and will track
and capture ANSI sequences in a more comprehensive fashion.
2026-09-22 15:57:58 +02:00
Lennart Poettering e355960ac1 Various imds fixes (#43772) 2026-09-21 13:58:58 +02:00
Lennart Poettering ada6409d6a vmspawn: bring external and internal enum value names back in sync
We generally want that the exposed strings for enum values and the
internal names for them stay in sync. Let's make sure this is the case
for the ConfidentialComputing enum.

This just changes the internal names, so that they match the external
ones. No user visible change, just some search and replace.
2026-09-21 12:37:25 +02:00
Lennart Poettering 41bf07afe1 man: add missing = 2026-09-18 20:23:00 +02:00
Lennart Poettering b1cb951a6f update TODO 2026-09-16 17:50:03 +02:00
Lennart Poettering e2c84823ed mountpoint-util: improve logging when kernel lacks support for a certain fs type
Inspired by #43752
2026-09-14 16:28:23 +02:00
Lennart Poettering f74b848a17 sysupdate: undo some accidental field renaming (#43707)
This undoes some of the work in #43603 which was a follow-up to #42900
which – unintentionally I'd claim – renamed some JSON fields. Instead of
setting those changes in stone we should undo them.

Not just to not needlessly break compat, but more importantly because
the old names made more sense given the underlying .feature file knobs.
2026-09-14 16:27:49 +02:00
Lennart Poettering f0baee29b3 sysupdate: change "appstream" json prop back to "appStream"
Similar as the previous commit: the field was renamed by accident, and
we should revert to the old name to not break compat needlessly, and
because the old name actually made sense, given the underlying .transfer
file knob is AppStream=
2026-09-14 15:15:58 +02:00
Lennart Poettering f05a0cef9f sysupdate: rename isEnabled to enabled
The "isEnabled" name was changed from "enabled" post v261 by accident
(because a6f7ded859 replaced json
formatting via table formatter to a native json generator which was
introduced for varlink, which changed the names). THis was later made
official in #43603, but it should rather have changed things back to the
original name, in particular as the underling .feature file field
actually is called "Enabled=" and not "IsEnabled=".

We really should take care to generate the same names for Varlink JSON
data as for the data returned by the systemd-sysupdate cli.
a6f7ded859 ensured that, so that's great.
But at the same time I think the varlink names should be adjusted to the
old names, since varlink support for this was just added in this cycle.

Given that v262 is not tagged yet, let's now revert to the old name.
2026-09-14 14:33:33 +02:00
Lennart Poettering aaab1f107c tree-wide: reference UAPI.20 spec that has been published for Varlink now
This updates a couple of links talking about Varlink:

1. anything that refers to specific Varlink concepts now point to the
   UAPI.20 spec

2. More general references to Varlink as a whole point to both the
   varlink.org domain and the spec.
2026-09-10 12:07:06 +01:00
Lennart Poettering 59117e6a34 core: fix two cases where we pass incorrect errors to logging 2026-09-09 17:24:09 +09:00
Lennart Poettering d7c3467fd9 NEWS: fix field name 2026-09-09 17:24:09 +09:00
Lennart Poettering 92c9f787a7 NEWS: various updates 2026-09-03 17:45:02 +02:00
Lennart Poettering 34e5f14c34 pam: use "pam_rootok" rather than "pam_deny" in the "auth" stacks of our PAM configs
PAM is a bit quirky: the main libpam calls are pam_authenticate(),
pam_open_session(), pam_acctmgmt(), pam_chauthtok(), pam_setcred() and
each have their own PAM "management group" in PAM configuration files
that configure the modules to call: "auth", "account", "session",
"password" – except for pam_setcred() which shares its grpup with
pam_authenticate() and uses "auth".

Both our PAM configuration files we ship by default are never used for
authentication (they just appear in PAMname= in a service to get a PAM
session set up, and PAMName= never calls pam_authenticate()). However,
they end up being used for pam_setcreds() (because some modules want to
use that the service manager calls it).

So far we used the pam_deny module for the "auth" management group for
these two PA; configurations (since
d6aed1dca8) but that's not ideal, since it
means we'll always cause pam_setcreds() to fail which will create debug
log noise (since the service manager debug logs pam_secreds() failures).

Let's switch to pam_rootok for this instead. This has the benefit that
pam_setcred() will always succeed for this, and pam_authenticate() only
if the caller is root anyway.

This is great, because it means our PAM configuration cannot be misused
for other purposes accidentally (authentication will fail, unless you
are already root), but won't result in any log noise (debug or
otherwise).

Follow-up for: d6aed1dca8
Fixes: #39617
2026-08-31 12:06:43 +02:00
Lennart Poettering f5d545ab77 core: fix error code passed to pam_syslog_pam_error() 2026-08-31 12:02:58 +02:00
Lennart Poettering d704a21ef9 Chores for RC1 (#43527) 2026-08-26 14:26:04 +02:00
Lennart Poettering 52d2fe7d83 dissect-image: tighten error path a bit
When we set up a device with LUKS or verity, we so far didn't release
references to the allocated device nodes even though we destructed the
volumes they are for. Let's fix that, and release everything.

This mostly matters for cases where multiple attempts to unlock are made
(for example because of a password issue), without releasing the
DissectedImage.
2026-08-24 16:32:37 +01:00
Lennart Poettering 9139f3c53f switch-root: do not check fs to sync against allowlist
This drops a good chunk of 21ab2fe6ec
again, which I think is plainly wrong or at the very least too
overengineered.

1. it's wrong to assume that overlayfs layers are mounted elsewhere in
   the fs. it's quite likely they aren't. and overlayfs correctly passes
   through fsync() to the top layer, hence we really should keep syncing
   it.

2. network file systems deserve syncing. This code here runs in the
   initrd, where a very restrictive set of file systems is mounted and
   which runs for a very short time only, i.e. the circumstances haven't
   really changed. Hence I am very sure it's better to sync file systems
   here than not to, we do this for safety reasons after all.
   Reliability always trumps speed here, we should not give up
   correctness over presumed speed improvements.

3. There's zero reason to believe FUSE doesn't need syncing. We live in
   a world where increasingly complex kernel file systems are moved to
   userspace, and hence FUSE can be used to implement *anything*. Hence
   we should sync it. Yes, FUSE means some backing process needs to run,
   but that's a job for the initrd to get right: make sure the process
   runs properly over the switch root if the mount is left in tact over
   the switch root too.

Hence, dumb this all down and drop the weird fine tuning here.
2026-08-24 14:06:59 +02:00
Lennart Poettering 6cff583546 update TODO 2026-08-24 11:56:27 +02:00
Lennart Poettering 31eaee07c3 ask-password-api: move oom check to the right place
Follow-up for: 92e2f70a3c
2026-08-18 02:12:00 +09:00
Lennart Poettering 215ad044d3 run: split out polkit ops into separate .c file (#43047) 2026-07-18 11:03:36 +02:00
Lennart Poettering 1f360f0abd run: simplify timer property handling
Let's make timer prop handling less special, and more like path/socket
handling. Let's move the checks for at least one OnXYZ= setting to a
common place at the end of parsing, instead of explicit checks for each
property.
2026-07-18 00:01:47 +02:00
Lennart Poettering 9793dde16e run: split out polkit ops into separate .c file
Let's shorten an already very long .c file, by splitting it apart a bit.

Splitting out the polkit code is relatively easy, since it does not
touch any of the arg_xyz variables.
2026-07-18 00:01:47 +02:00
Lennart Poettering 6eb6a61a96 update TODO 2026-07-17 16:38:14 +02:00
Lennart Poettering 8009fa4984 boot: fix MEMMAP_DEVICE_PATH EndingAddress field calculation
Let's do what EDK2 does.

Fixes: #43038
2026-07-17 01:17:14 +09:00
Lennart Poettering 59d04da90c repart,dissect: explicitly support DDIs that are both signed *and* encrypted (#43009)
This is a pretty relevant usecase: preparing an image on some trusted
host, submitting it to some other host that authenticates it and
decrypts it, and consumes it only then.

Let's support this explicitly.
2026-07-16 13:40:49 +02:00
Lennart Poettering d14c40919a ci: add test suite for verity+luks disk images 2026-07-16 07:10:07 +02:00
Lennart Poettering 1423d78dc9 dissect-image: support activating luks+verity partitions
Let's properly activate images that have both LUKS and Verity enabled
for a partition.
2026-07-16 07:05:39 +02:00
Lennart Poettering 628c3f25f1 repart: say when we are calculating Verity data
We say when we encrypt a partition, let's also say when we calculate
verity protection data.
2026-07-16 07:05:39 +02:00
Lennart Poettering 02cd3fd879 repart: support generating LUKS+Verity partitions
For various cases it is interesting to both sign and encrypted a file
system, for example to prepare it on one host and provide it to another.
Let's explicitly support preparing this in systemd-repart via setting
both Verity= and Encrypt=.
2026-07-16 07:05:39 +02:00
Lennart Poettering 07a9d1f929 update TODO 2026-07-16 07:05:10 +02:00
Lennart Poettering bf4263b92e update TODO 2026-07-15 13:27:48 +02:00
Lennart Poettering b0cf7d60ac ci: add test for the various new sysupdate features 2026-07-15 13:27:48 +02:00
Lennart Poettering 1cd217ee81 shell-completion: add shell completion for systemd-sysupdate 2026-07-15 13:27:48 +02:00
Lennart Poettering 87f4e729d8 man: document the new .component files 2026-07-15 13:27:48 +02:00
Lennart Poettering b488ee3dcc man: document the new systemd-sysupdate switches and verbs 2026-07-15 13:27:48 +02:00
Lennart Poettering 559f52ee3f units: add unit that can auto-enables all suggested component/features
if enabled it will plug itself before systemd-sysupdate-update.service
and enable every component + feature that is suggested.
2026-07-15 13:27:48 +02:00
Lennart Poettering ca5ddf8cc0 units: update all components in systemd-sysupdate-update.service
Let's beef up systemd-sysupdate-update.service and update not just one
component but all enables ones.
2026-07-15 13:27:48 +02:00
Lennart Poettering 921f63447b sysupdate: add support for 'update --component-all'
Let's add a way to quickly update all components that are enabled.
2026-07-15 13:27:48 +02:00
Lennart Poettering e6acf0bab7 resolved: fix spurious BrowseServices add/remove flapping with ifindex=0 (#42982)
## Problem
A `BrowseServices` subscription with `"ifindex":0` (browse all
interfaces) receives a continuous flap of `added`/`removed` events for a
service that is still present — within a second, and with no goodbye
packet involved.

## Root cause
For `ifindex==0`, `mdns_browser_revisit_cache()` looked up each mDNS
scope's cache separately and called `mdns_manage_services_answer()`
**once per scope**. That function derives `removed` events by diffing
the browser's *global* discovered-service list (all interfaces, filtered
only by owner family) against the single answer it's handed. So with ≥2
mDNS-relevant interfaces of the same family, a service present on
interface A isn't in interface B's answer and is spuriously removed
while B is reconciled, then re-added on the next revisit tick.

## Fix
Accumulate the pruned cache answers from every matching mDNS scope into
one combined `DnsAnswer` and reconcile **once**, so removals diff the
global list against the union across interfaces. Items are merged with
`dns_answer_add_full()` (not `dns_answer_extend()`, which defaults each
item's `until` to `USEC_INFINITY` and would skew the RFC 6762 §5.2
TTL-maintenance schedule). The single-interface (`ifindex>0`) path is
unchanged.

## Test
`TEST-89-RESOLVED-MDNS.sh` gains `testcase_browse_ifindex_zero_no_flap`:
it adds a service-less dummy mDNS link to guarantee ≥2 same-family
scopes (the flap precondition), browses `ifindex=0`, waits for
discovery, then asserts **zero** `removed` events while every publisher
stays up. The subscription uses `varlinkctl --timeout=infinity`, since
it sits idle after discovery and the default 45s idle timeout would
sever it (and the assertion) mid-observation.

## Testing status
Builds clean; `shellcheck -x` clean. First CI round: `TEST-89`
(including this testcase) passed on all mkosi platforms; the failing
jobs all traced to unrelated flakes/infra.
2026-07-14 23:58:34 +02:00
Lennart Poettering d26de063cd version_is_valid() tweaks (#43025)
We have two validators, and neither really makes sense. Let's unify and
clean things up.
2026-07-14 23:46:40 +02:00
Lennart Poettering 231cde8089 Assorted basic/shared/home/import hardening fixes flagged by kres (#42950) 2026-07-14 23:31:53 +02:00
Lennart Poettering 64a3846ced sysupdate: Add ListFeatures() and ListTargets() varlink methods (#42900)
Following on from adding the basic varlink scaffolding to sysupdate,
let’s varlinkify a couple of the D-Bus methods. Because varlink doesn’t
have a concept of object paths, the D-Bus path structure which allows a
target to be selected has been squashed down to a target argument for
each relevant method.

Varlinkify the way to list targets, and also the way to list features
because that was simple to do at the same time.

More methods need varlinkifying in the future, but let’s do it in small
and manageable chunks.
2026-07-14 23:14:22 +02:00
Lennart Poettering e0142a76ac test: extend version_is_valid() testcase a bit 2026-07-14 22:32:27 +02:00
Lennart Poettering 8814cc9f1e bootspec: log about invalid version strings 2026-07-14 22:32:27 +02:00
Lennart Poettering 5051def45c man: update version formatting requirements in os-release
Allow full UAPI.10 version strings, i.e. "+", "_", "~" and "^" too, to
match the recent reworking.

These version strings are generally distro-managed, hence use the more
liberal alphabet.

Fixes: #32785
2026-07-14 22:32:27 +02:00
Lennart Poettering 093cac3fe8 string-util: replace version_is_valid()/version_is_valid_version_spec() by a common call
Let's take inspiration from string_is_safe() and take a flags field that
allows fine tuning the validation.

Then port over all current users of either function to the new logic.
Note that this *does* change behaviour in various cases:

1. Generally: we'll now always accept the full UAPI.10 alphabet,
   including the "~" and "^" characters. As far as I can see there's no
   downside to this liberalization as none of the current consumers of
   the two functions uses these characters for anything else.

2. systemd-analyze compare-version will now accept version strings with
   "_" and "+" without complaining. I see no downside here, it just
   normalizes these debugging tools, to make them accept what most our
   other tools accept.

3. "bootctl link" will not accept empty version strings anymore
   Which is a bugfix I guess.

4. vpick will now refuse "_" and "+" in version strings. It kinda
   already did, because when parsing versions from filenames it uses "_"
   and "+" as name, architecture and attempt counter separators. We now
   systematically refuse it everywhere else in vpick too. This is hence
   a clean-up.

Fixes: #28906
Replaces: #42815 #41937
2026-07-14 22:32:27 +02:00
Lennart Poettering d9b2960d4d string-util: reorder characters in version charset
Let's bring the version string character set into a systematic order,
matching the order in which they appear and are defined in the UAPI.10
specification text.

This makes it easier to compare the relevant functions.
2026-07-14 22:32:27 +02:00
Lennart Poettering 6acae8d17d string-util: do not accept ',' in version strings
Allowing this apparently has been cargo-culted from my initial sysupdate
PR, but Claude and me could not find a single other software package
that uses "," as a character within version strings. Hence, let's remove
this, even though this is a compat breakage of a kind, in the hope
nobody notices. We can easily restore this if this later shows to be an
issue for people.
2026-07-14 22:32:27 +02:00
Lennart Poettering b14e60c983 sysupdate: use strverscmp_improved() like everywhere else
At one location we accidentally called strverscmp() instead of
strverscmp_improved()
2026-07-14 22:32:27 +02:00
Lennart Poettering 89025e8f86 repart: Fix growing the partition preceding a FreeArea from leftover space (#42969)
The "Donate to preceding partition" logic is dead code since commit

https://github.com/jonas2515/systemd/commit/19903a433507897449c086b72abb5e133e431336
("repart: split out context_grow_partition_one()").
context_grow_partition_one() gets passed a free area and a partition,
and it has
an early-return check to ensure the partition it got passed belongs to
the free
area it got passed. That means we compare the FreeArea a to the FreeArea
a->after->allocated_to_area, which always yields FALSE.

Fix the behavior of donating any left over space to the preceding
partition
by adding that partition to the loop below (and relying on the
partitions list
being ordered according to physical partition offsets).

Since this behavior is not that easy to trigger, mention how to trigger
it in a
comment, and add a test for it as well.
2026-07-14 11:27:57 +02:00
Lennart Poettering de39ad2cfe boot: skip boot counter logic for entries marked read-only
If the read-only FAT file attribute is set on a boot entry file with a
counter in its name, don't attempt to rename it, but simply skip the
boot counter logic for it, taking the flag as a hint that the entry
shall not be subject to boot assessment.
2026-07-14 10:13:17 +02:00
Lennart Poettering 38f63d28c2 boot-secret: don't initialize secret mixin file if marked read-only
If the boot secret mixin file exists but is empty we'd normally fill it
with a fresh mixin. Refrain from that if the read-only FAT file
attribute is set on it, taking that as a hint that the file shall not
be initialized. Reading an existing, fully populated mixin file remains
unaffected by the flag.
2026-07-14 10:12:50 +02:00
Lennart Poettering 78f81f02e8 boot: skip random seed handling if seed file is marked read-only
If the read-only FAT file attribute is set on /loader/random-seed,
don't update the seed file — and hence don't use it either, since a
seed we cannot update would be the same on every boot.

This gives users an explicit way to turn off random seed handling by
marking the file read-only, useful for example in pre-built OS images
that are replicated to many systems, where the baked-in seed is shared
and hence must not be credited.

The check is done upfront in process_random_seed(), before any other
work, mirroring the existing check for read-only volumes. This covers
both systemd-boot and systemd-stub, which share this code.

Inspired-by: #42979
2026-07-14 10:12:50 +02:00
Lennart Poettering 6ce0759d99 repart: allow empty EncryptedVolume= volume name (#42889)
Treat an empty volume name alongside other fields as unset instead of
rejecting it as invalid.

Example use case:
```
EncryptedVolume=:none:discard
```

In this case, the volume name is not specified so it can be generated as
luks-UUID.

From the docs:

> EncryptedVolume=
> Specifies how the encrypted partition should be set up. Takes at least
one and at most four fields separated with a colon (":"). The first
field specifies the encrypted volume name under /dev/mapper/. If not
specified, "luks-UUID" will be used where "UUID" is the LUKS UUID.
2026-07-13 18:47:09 +02:00
Lennart Poettering c8cffba715 cryptsetup: add Argon2id-based PIN mode for TPM2 enrollment (#41859)
The current TPM2 PIN mode is flawed as a compromised TPM directly
exposes
the sealed secret which is the LUKS volume key itself
(https://github.com/systemd/systemd/pull/27502 and
https://github.com/systemd/systemd/issues/37386).

Goal: add Argon2id-based PIN hardening to TPM2 enrollment, making
the TPM a second factor rather than a single point of failure:

1. Password + salt → Argon2id → 512-bit key split into Key1 + Key2
2. Key2 (base64-encoded) is used as the PIN to seal a random secret
in the TPM
3. Key1 + unsealed secret → HKDF-SHA256 → final LUKS volume key

This implementation ensures that if the TPM is compromised, an attacker
still needs the password to derive Key1 and combine it with the unsealed
secret.

The --tpm2-with-pin= option now accepts three values:
- false (no PIN used)
- true (PIN hardened with Argon2id - default)
- "direct" (legacy PIN without Argon2id for backward compatibility)

Argon2id parameters are customizable via:

--tpm2-argon2id-memory=
--tpm2-argon2id-iterations=
--tpm2-argon2id-parallelism=
--tpm2-argon2id-iter-time=

These default to a function of available CPUs and physical memory, with
a benchmark that scales iterations to the target time (default: 2s) and
falls back to ARGON2ID_PARAMETERS_DEFAULT (64 MiB, 8 iter, 4 lanes) when
auto detection fails.
Also if the runtime OpenSSL lacks Argon2id support (< 3.2), the feature
silently falls back to direct PIN mode with a warning.

Added includes:
- src/cryptenroll/cryptenroll.c: cpu-set-util.h, limits-util.h,
time-util.h
for Argon2id benchmark auto-tuning (cpus_online, physical_memory_scale,
  now/usec_t)
- src/cryptenroll/cryptenroll-tpm2.c: crypto-util.h for
Argon2IdParameters
  struct in load_volume_key_tpm2()
- src/shared/tpm2-util.h: crypto-util.h for Argon2IdParameters in
  tpm2_make_luks2_json() API
- src/cryptsetup/cryptsetup-tokens/luks2-tpm2.c: crypto-util.h for
  kdf_argon2id_derive()/kdf_hkdf_sha256() on the token unlock path
2026-07-13 17:55:47 +02:00
Lennart Poettering 4481661a75 sysupdate: add support for --component-all + --feature-all + --feature-suggested to enable-feature verb
This adds similar concepts as we already have for enable-component:
let's add a way to enable all features or the suggeste dones, and
possibly on all components.

Or in other words, with this:

  systemd-sysupdate enable-component -S
  systemd-sysupdate enable-feature -A -s

We'll automatically enable all suggested components, and all features of
them.
2026-07-13 17:36:11 +02:00
Lennart Poettering 9f3b604d64 sysupdate: validate feature name syntax before using it
Let's tighten the rules on features, and enforce a sensible naming
policy.
2026-07-13 17:36:10 +02:00
Lennart Poettering f23224a7ca sysupdate: add feature select
Prepartion for the next commit: also allow selecting the all or
suggested features.
2026-07-13 17:36:10 +02:00
Lennart Poettering 52d9906a54 sysupdate: implement --component-all and --component-suggested for enable-component and disable-component
Let's now introduce "systemd-sysupdate enable-component
--component-suggested" and systemd-sysupdate enable-component
--component-all" for enabling all or all suggested components at once.
Similar, if used for disable-component will disable all components or
those not suggested.
2026-07-13 17:36:10 +02:00
Lennart Poettering 8f9a2f0c82 sysupdate: introduce --component-suggested similar to --component-all
While --component-all really picks all components --component-suggested
picks only the suggested ones.

Note that none of the verbs currently implement the concept, they will
all refuse the option. Hooking this up is going to be added next.
2026-07-13 17:36:10 +02:00
Lennart Poettering 40e727c93b sysupdate: add a "suggests" concept to features and components
Let's make it possible to "suggest" that certain features or components
are enabled under some conditions.

For this, both features and components gain two things:

1. A Suggested= field which takes a boolean. If true the
   feature/component will be suggested for installation, if false it
   will not.

2. A set of SuggestedOnXYZ= settings are modelled after ConditionXYZ= in
   unit files (and implement a subset of them), will suggest some
   component/feature under specific conditions.

The result of the condition is shown in the various output tools.
2026-07-13 17:36:10 +02:00
Lennart Poettering 3b38a4f240 tree-wide: port to prctl_safe() 2026-07-13 15:39:17 +02:00
Lennart Poettering 2d63905096 nsresource: port from PR_GET_NAME to pid_get_comm()
SImilar reasons as for the memfd change: let's normalize behaviour and
always use pid_get_comm().

This adds escaping here for the first time, which is a good thing.
2026-07-13 15:39:17 +02:00
Lennart Poettering b484f983fc memfd-util: port to pid_get_comm()
Let's the common function for querying the local thread name.

This changes the escaping rules when the therad name is not quite
kosher: previously we'd just escape invalid UTF-8 charcaters, now we do
what we usually do: also escape control characters and such, and limit
us to ASCII.

The description generated here is mostly for debug purposes, and process
names should normally not require this escaping anyway (it's mostly
paranoia), hence I think this change in behaviour should be fine, it's
not part of the API in any form.
2026-07-13 15:39:17 +02:00
Lennart Poettering 4d84f8fac3 process-util: introduce proc_get_timerslack() 2026-07-13 15:39:17 +02:00
Lennart Poettering 3ac3632e28 process-util: introduce trivial proc_set_nnp() helper 2026-07-13 15:39:16 +02:00
Lennart Poettering 0e077d3eea process-util: introduce proc_set_comm() helper
This operation is done at a bunch of places, let's add a type-safe
helper for it.
2026-07-13 15:39:16 +02:00
Lennart Poettering d3c0348c8b process-util: introduce prctl_safe() 2026-07-13 15:39:16 +02:00
Lennart Poettering 755efbe410 sd-varlink: async upgrade support (#42974)
With 2c6f9af8e5 sd-varlink gained protocol
upgrade support, however only in a synchronous fashion. This adds
asynchronous protocol upgrade for the server side, thus enabling
multiplexing daemons (i.e. those that handle multiple connections from
the same event loop) to support protocol upgrades too.

I plan to use this in the upcoming "ptybroker" component that allows
acquiring a pty through varlink.

/cc @mvo5
2026-07-13 14:29:06 +02:00
Lennart Poettering 649ab380e1 nresourced: add user.userbd.* xattrs to nsresourced userdb socket 2026-07-13 09:53:15 +02:00
Lennart Poettering 33b2db3c8f machined: set user.userdb.* xattrs on machined socket 2026-07-12 23:09:01 +02:00
Lennart Poettering e3876f7559 homed: set user.userdb xattrs on homed's userdb socket
We can't make a lot of restrictions here, since users are allowed to
basically freely pick their user names and UIDs too. But let's at least
exclude system UID ranges and those beyond the 16bit range.
2026-07-12 23:09:01 +02:00
Lennart Poettering 845786f60b core: tag dynamic user userdb provider with dynamic uid/gid ranges
Let's optimize lookups to PID 1's dynamic UID/GID range feature.
2026-07-12 23:09:01 +02:00
Lennart Poettering 00a7b1d2d8 userdb: suppress lookups outside of indicated ranges
When doing a userdb lookup we might end up issuing a lot of IPC calls in
parallel to backends and cause them all to do work, with us waiting for
it. Let's optimize this a bit, and indicate on the socket inodes via
xattrs hints which kind of records are provided by a backend. That way
we can suppress lookups to them and optimize runtime behaviour.

This only works on Linux 7.1 and newer where socket inodes gained
support for extended attributes.
2026-07-12 23:09:01 +02:00
Lennart Poettering 65796105a9 userdb: drop redundant check 2026-07-12 23:06:52 +02:00
Lennart Poettering 953d21846a sd-varlink: add sd_varlink_call_and_upgradeb() + sd_varlink_call_and_upgradebo()
This are to the existing sd_varlink_call_and_upgrade() what
sd_varlink_callb() and sd_varlink_callbo() are to sd_varlink_call():
they put together an object on the fly, via the usual JSON builder
logic.
2026-07-12 22:44:03 +02:00
Lennart Poettering 746d10d106 sd-varlink: add async server-side upgrade API 2026-07-12 22:44:03 +02:00
Lennart Poettering f194afa164 sd-varlink: move varlink_handle_upgrade_fds() before sd_varlink_process()
This is a simple move, in preparation for using this as part of the
sd_varlink_process() callchain.
2026-07-12 22:37:51 +02:00
Lennart Poettering 260fcf9763 sd-varlink: fold separate 'protocol_upgrade' flag into state machine 2026-07-12 22:37:48 +02:00
Lennart Poettering 755f1cff89 json-stream: add helper json_stream_has_buffered_output() 2026-07-12 22:32:40 +02:00
Lennart Poettering 9a09141cae Assorted basic/shared/ndisc/import hardening fixes flagged by kres (#42934) 2026-07-12 22:17:08 +02:00
Lennart Poettering 4f2521feca man: run forgotten 'update-man-rules' 2026-07-10 21:43:27 +01:00
Lennart Poettering 5c0453113b sysupdate: enable/disable verb for features and components (#42947)
These are the next 3 commits from #42651. Split out again, in the hope
to get a review from claude.

ptal.

full test suite and docs are in #42651. test suite passed there.
2026-07-10 17:23:22 +02:00