Commit Graph
90562 Commits
Author SHA1 Message Date
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
Luca Boccassi 2e1c8bc3d7 udev: fix several option parsing edge cases (#42997)
Boundary tests were conducted on the udev subsystem, and some issues
were identified and resolved.
2026-07-13 13:42:27 +01:00
Luca Boccassi 061490432e repart: Some fixes for --copy-from= (#42976)
A bunch of things I noticed that aren't correct about `--copy-from` and
grain sizes + paddings.
2026-07-13 13:33:24 +01: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
Jonas Dreßler 71d20a990e repart: Don't copy trailing padding when using --copy-from=
Currently, --copy-from= copies the paddings in between the source partitions,
as well as the trailing padding that is at the end of the source partition table.
It doesn't copy the leading padding at the start of the source partition table
though.

This seems inconsistent, and likely it was an oversight that the trailing padding
is copied.

Fix that, and add a test to ensure we don't regress.
2026-07-13 12:23:20 +02:00
Jonas Dreßler 0df5ebc079 repart: Clarify and test that --copy-from= argument respects grain size
The --copy-from= argument currently is documented as "copied partitions will have
the same size". This doesn't hold true in the case where a different grain-size is
passed to repart. Because `partition_min/max_size()` currently do rounding, the
size is implicitly rounded to grain size, and therefore partitions are enlarged
to align to grain size whenever possible.

Clarify this behavior and change the manpage, and also add a test for it.
2026-07-13 12:09:43 +02:00
Jonas Dreßler 2b1be5d909 repart: Don't get old grain size from fdisk for --copy-from=
This is a little bit confusing, but grain size is not actually stored in the gpt
metadata. Rather, fdisk's `get_grain_size()` returns an autodiscovered "optimal io
size" value as grain size. This might not actually be the grain size that the
disk we're copying is using.

Since we're setting the padding of the copied partitions using that value from
fdisk, we're rounding the new paddings by fdisk's optimal grain size, which is
usually 1MiB (a lot more then the default 4KiB that we're using otherwise).

Set the grain size here to 1 byte instead, ensuring that the min/max padding set
is exactly the padding that was present before.

Also add a test to confirm the behavior is fixed: The test calls --copy-from= on
an existing disk with 4MiB grain size, and because we pass --grain-size=512, now
no rounding should happen and the paddings should be transferred to exactly the
same size.
2026-07-13 12:09:13 +02:00
dongshengyuan 4106cf7439 udevadm-trigger: reject invalid wait-daemon timeout
Return from argument parsing when --wait-daemon= cannot be parsed.

This matches the other timeout options.

Reproducer:
  udevadm trigger --dry-run --wait-daemon=bad

Before:
  Failed to parse timeout value 'bad', ignoring: Invalid argument

Follow-up:
  2001622c58
2026-07-13 12:18:49 +08:00
dongshengyuan 20e1e2de67 udev-config: merge configured children max
Merge children_max from the per-source UdevConfig values before
defaulting it from system resources.

Reproducer:
  systemd-udevd --debug --children-max=1

Before:
  Set children_max to 32

Follow-up:
  04fa5c1580
2026-07-13 12:18:49 +08:00
dongshengyuan e8dd0bfbbe man/udevadm: update device-id-of-file arguments
udevadm info rejects positional devices together with
--device-id-of-file=.

Document that behavior instead of saying positional arguments are
ignored.

Reproducer:
  udevadm info --device-id-of-file=/etc/passwd /sys

Before:
  Devices are not allowed with -d/--device-id-of-file and -c/--cleanup-db.

Follow-up:
  31767b92a0
2026-07-13 12:18:49 +08:00
dongshengyuan 778f932032 udevadm-settle: reject positional arguments
The settle command does not define positional arguments.

Reject them during argument parsing instead of silently ignoring
them.

Reproducer:
  udevadm settle /no/such/argument

Before:
  The command exits successfully and ignores the argument.

Follow-up:
  c71509028f
2026-07-13 12:18:49 +08:00
dongshengyuan 7bd6b8c587 udevadm-wait: let --removed override initialization
The documentation says --initialized= is ignored when --removed is
specified.

Track --removed separately so it wins regardless of option order.

Reproducer:
  udevadm wait --timeout=0 --removed --initialized=no /dev/no-such-test-device

Before:
  Timed out for waiting devices being added.

Follow-up:
  aa2b0d8d29
2026-07-13 12:18:49 +08:00
dongshengyuan c5a6425b81 udevadm-info: allow valueless attr filters
The --attr-match= and --attr-nomatch= filters are documented as
FILE[=VALUE], like the trigger filters.

Accept a bare attribute name for sysfs attribute presence matches.

Reproducer:
  udevadm info --export-db --attr-match=ifindex

Before:
  Expected <ATTR>=<value> instead of 'ifindex'

Follow-up:
  a6b4b2fa01
2026-07-13 12:18:48 +08:00
dongshengyuan 9725124635 udev: avoid reading before empty capability masks
When input_id prints a decoded capability bitmap, an all-zero
bitmap can decrement the index to zero.

Check the index before reading bitmask[val - 1].

Reproducer:
  udevadm test-builtin input_id with an all-zero capability mask

Follow-up:
  912541b024
2026-07-13 10:59:00 +08: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
Luca Boccassi 23213578f0 claude-review: downgrade effort from xhigh to high
Claude reviews keep failing due to hitting 60m timeouts, as they take
too long. Lower effort from xhigh to high to try and speed them up.
2026-07-13 02:11:00 +09:00
Hans de Goede 641c7026d7 hwdb: sensor: Add Odys Windesk X10 accel mount matrix
Add a mount matrix for the accelerometer on the Odys Windesk X10 tablet to
fix auto-rotation.
2026-07-12 13:27:15 +01:00
Luca Boccassi 627fae0227 Revert "claude-review: bump timeout from 60m to 120m"
This reverts commit 6f04b8e571.
2026-07-12 13:41:46 +09:00
Luca Boccassi 6f04b8e571 claude-review: bump timeout from 60m to 120m
Claude got slower, but in many cases it's on the brink of finishing the
review when the timeout kicks in. Double it.
2026-07-12 06:56:43 +09:00
Luca Boccassi 1219b0e816 ci: check 'update-man-rules' to ensure it is not forgotten
We often forget to run this command when updating manpages, and notice
only much later. Add a step in the CI to flag it, as we already do for
the D-Bus docs.
2026-07-12 06:55:10 +09:00
Luca Boccassi 2d85bba6b9 nss-myhostname: keep IPv6 probe result stable
Cache the IPv6 enabled state while sizing and filling NSS result
buffers, so a transient sysctl read result cannot change the tuple or
address layout after the scratch buffer size has been computed. Also
zero-initialize gaih_addrtuple records before filling IPv4 addresses.

Follow-up for e8a7a31539
2026-07-11 17:09:14 +01:00
Luca Boccassi 19c08f2dfa creds: tolerate TPM2 seal failure in auto mode
Automatic key modes tolerate a failed TPM2 sealing attempt and
fall back to a host or null key. Do not consume TPM2 blob output in
that case, tpm2_seal() leaves it empty on failure, so the fallback
path should continue without TPM2 metadata.

Follow-up for 9e4379945b
2026-07-11 17:09:13 +01:00
Luca Boccassi 8baed40298 ndisc: reject non-zero ICMPv6 codes in parsers
NDisc packets received through the socket path are filtered before
parser dispatch, but parser entry points should still reject malformed
packet bytes instead of asserting on them. Return EBADMSG for non-zero
ICMPv6 code values in RA, NA, and Redirect messages.

Follow-up for c34cb1d645
Follow-up for 696eb2b8de
Follow-up for 44e8cf303b
2026-07-11 17:07:53 +01:00
Luca Boccassi ad0996191d pull-oci: verify redirected manifest digest
An OCI index redirect already carries the digest of the selected
manifest. Store it in the expected checksum field so pull-job
verifies the downloaded manifest instead of overwriting the digest
with the computed checksum before comparison.

Follow-up for a9f6ba0496
2026-07-11 17:07:52 +01:00
Luca Boccassi 4309f68236 efivars: fix concurrent growth read accounting
efi_get_variable() allocates one byte for probing whether efivarfs
has grown since fstat(), then three more bytes for NUL termination.
Account for both sizes separately so a full readv() result is treated
as concurrent growth and retried before the terminators are written.

Follow-up for ab69a04600
2026-07-11 17:07:52 +01:00
Shihao Ren dbb59dab73 network: do not regenerate MAC address if already set by userspace
When MACAddress= is unspecified, a stable MAC is generated to seed a newly
created netdev. Since existing netdevs are reconfigured on reload/restart,
this seed got re-applied to an already existing interface, conflicting with
an explicit MACAddress= from the matching .network file and flipping MAC.

Now, when MACAddress= is unspecified, only generate a new address if
addr_assign_type is not NET_ADDR_SET (i.e. not already set by userspace). On
first creation the interface does not exist yet, so this is a no-op and the
address is generated as before. Mirrors src/udev/net/link-config.c.

Fixes: #42457
2026-07-12 00:00:01 +09:00
Popax21 70cfb11d4b creds-util: implement TPM2 SRK pinning
Stores the TPM2 SRK within the credential header, allowing for parameter decryption to be utilized when decrypting the credential.
A new dimension is added to the credential ID matrix to encode this capability.

This also allows for usage of TPM2-bound credentials when a TPM owner password is set since `Esys_CreatePrimary` is no longer used for sealing credentials.
2026-07-11 15:37:46 +01:00
Michael Vogt 8877f63ee1 creds: allow normal users to encrypt with--with-key=null
When encrypting with the `--with-key=null` option systemd-creds
is currently doing the encryption via IPC. This is not needed
for the null key, no privs are required so we can just do the
in-process operation. So instead simply check for the null-key and
if its requested use the in-process path.
2026-07-11 10:38:46 +01:00
Lennart Poettering 4f2521feca man: run forgotten 'update-man-rules' 2026-07-10 21:43:27 +01:00
Luca Boccassi 73fd02543c mkosi: update debian commit reference to b322b8d98e0192763aa711dc2aa2f98d8276aae3
* b322b8d98e Install new files for upstream build
* 3fd1b81c94 Update changelog for 261.1-3 release
* 8f95f1370c Move modules-load from systemd package to udev package
* bcdf90c670 debian/libpam-systemd.postinst: pam-auth-update does not use getopt
* 743e3399ac d/README.source: document policy for adding new binary packages
* cbea74783c Install new files for upstream build
* ef267b3ad6 debian/libpam-systemd.postinst: run pam-auth-update with --root=$DPKG_ROOT
* 54df2859b4 d/t/upstream: use mkosi from archive for Ubuntu autopkgtest
* 21959e8a59 Fix zsh installation path, again
* f01dddb047 Fix zsh installation path
* e31737edc4 Install new files for upstream build
* ca0630a51e Update changelog for 261.1-2 release
* 1ebb987599 d/t/control: pull in cpio for upstream suite
* fcf5a24f47 Two more fixups for d/copyright
* 6ad198086d d/t/control: pull new packages in upstream test suite
* bb9fd757fd Make systemd actually temporarily depend on systemd-tpm
2026-07-10 17:03:25 +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
Luca Boccassi 334d5b546a obs: explicitly disable Ubuntu/i586 builds
i586 is a partial architecture on Ubuntu, so package builds cannot
work, explicitly disable it to avoid visual clutter in the build
report page.
2026-07-10 14:27:02 +01:00
Yu Watanabe 900c10467a man: drop '\r' from systemd-clonesetup.xml
Follow-up for 104970a8bd.
2026-07-10 14:22:17 +01:00
Lennart Poettering 5cead3f269 credentials: add policy that can allow key=null creds from the ESP (#42555)
This PR only sets the default to "relaxed" - I can change the default
to "tofu" if desired. But for that we will also need to update the NEWS
file to ensure everyone is aware of this new default.

---

This PR adds a new `systemd.credentials-boot=` kernel
commandline that allows to control if credentials with
a `null` key are accepted.

The possible options are:
* strict: always insist on tpm encryption
* tofu: allow null encryption in firstboot mode and when no tpm is
available
* relaxed: allow null encryption when sb is off, or no tpm is available
* off: allow null encryption always

The default is `relaxed` which is exactly the behavior we had before.

This replaces the initial idea of using plaintext credentials
at firstboot (thanks to Lennart for this nicer and simpler design).

---

With that we can drop `- firstboot: optionally accept credentials at
firstboot without authentication` from TODO.md
2026-07-10 14:43:12 +02:00
Lennart Poettering 091bd0ed21 Add support for aarch64 CPUFeatures (#42902)
Extend real_has_cpu_with_flag to support aarch64 CPU Features using
hwcaps.

With this PR, users can find out if their Arm system supports
architecture-specific features such as BTI as follows:

```
$ systemd-analyze condition 'ConditionCPUFeature=bti'
```
2026-07-10 14:41:01 +02:00
Lennart Poettering 0d889c48f5 sysupdate: move cleanup verb up close to "vacuum"
These are philosophically similar concepts: one deletes old versions
based on whether they are old, and the other deletes old files based on
whether they are orphaned, let's list them together.
2026-07-10 14:37:17 +02:00
Lennart Poettering 14d914ac7f sysupdate: tighten component_name_valid() mildly
Let's make sure that we can still generate a component enablement
drop-in for any component that might be defined.
2026-07-10 14:37:17 +02:00
Lennart Poettering 779c328a79 sysupdate: add new enable-component/disable-component verb
This mimics the enable-feature/disable-feature verbs, but operates on
whole components, not features.
2026-07-10 14:37:17 +02:00
Lennart Poettering 0c7992f674 sysupdate: add enable-feature/disable-feature verbs
These do what updatectl's verbs of the same name does, but are
implemented as low-level concepts in sysupdate itself.

(The idea is to eventually wrap this in Varlink IPC, and make updatectl
use them that way.)
2026-07-10 14:37:17 +02:00
Lennart Poettering d298f9bc8e sysupdate: generalize feature name validity check
Let's switch to string_is_safe(), and make this available to the rest of
the sysupdate sources too.

This both relaxes and tighten the rules slightly. i.e. control character
and stuff are no longer allowed, but valid UTF-8 (as opposed to ASCII)
now is.
2026-07-10 14:37:17 +02:00
Lennart Poettering 058cbd2aba sysupdate: explicitly refuse --root=/--image= in conjunction with --definitions=
This is currently effectively not supported (as we sometimes prefix the
definitions path with root and sometimes not), let's make this official
for now and refuse it. We could in theory support the combination but I
don't see the big benefit of it for now, hence let's just refuse it.
2026-07-10 14:27:11 +02:00
Kai Lüke c8a2e035ce sysupdate: Evaluate all patterns before descending into a subdir
When we have two match patterns, e.g., because the repository layout
changed and we look for old and new style files, we can have the case
that one pattern suggests a descend into a subdir but the other pattern
would be a direct match. This was missed and only the descent was done.
Yet the other way round also has to be covered: We can't just use the
direct match because it might be that it's rejected if the type doesn't
fit (directory vs. regular file). In this case we should still descent.

Remember that we want to descend but continue checking the other
pattern first to maybe get a direct match. Introduce a new combined
return code YES_AND_RETRY to give the full information to the caller
which now can decide to fallback to a descent. While at it, use the
stat info for the directory check. Also add tests to ensure that the
order of patterns doesn't matter and we handle the above corner cases.
2026-07-10 14:25:38 +02:00