Commit Graph
91738 Commits
Author SHA1 Message Date
Alberto Planas 299989fe0b pcrlock: retry policy submission when PCR values keep changing
make_policy() already retries unsealing the recovery PIN when the TPM
reports that PCR values changed, but the tpm2_policy_super_pcr() call
that builds the policy for that unseal attempt was not covered: a
concurrent PCR extension there aborted the whole operation on the first
try.

This is easy to hit when IMA is enabled (e.g. implicitly through secure
boot), as PCR 10 is extended for every kernel module that gets loaded.

Retry that step within the existing loop, and give the retry budget a
name while at it.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Alberto Planas 1fc5351945 tpm2-util: log transient PCR changes in tpm2_policy_super_pcr() at debug level
tpm2_policy_pcr() returns -EUCLEAN when the TPM's global PCR update
counter moved while the policy was being submitted, not when the
recorded PCR values disagree with the current state.  Logging "Either
the system has been tampered with or the provided policy is incorrect"
at error level is therefore wrong, and it is noisy too: the condition is
transient and callers are expected to restart the policy session.

Downgrade both occurrences to debug and describe what actually happened,
and document the contract at the declarations.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Alberto Planas 2994ca5226 creds: don't report a malformed PCR signature file as changing PCRs
tpm2_load_pcr_signature() propagates the JSON parser's errno, and the
parser reports a string that is not valid UTF-8 as -EUCLEAN.  With
EUCLEAN now mapping to io.systemd.Credentials.PCRsKeptChanging, such a
file would be reported as if a PCR were being extended continuously.

Translate it where it originates, so that the errno stays single valued
for every caller of tpm2_load_pcr_signature() and not only for the creds
one: a signature file that cannot be parsed is -EBADMSG, whichever way
it is malformed.  A syntax error used to come out as -EINVAL, which
matched nothing on the way out either.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Alberto Planas 42f3ac664a creds: add io.systemd.Credentials.PCRsKeptChanging error
io.systemd.Credentials.UnexpectedPCRState used to be mapped to EUCLEAN,
which now means "a PCR kept being extended while unsealing" rather than
"the PCR state does not match the policy".  Map it to EPERM instead,
which is one of the errnos ERRNO_IS_NEG_TPM2_UNSEAL_BAD_PCR() covers,
and introduce a separate PCRsKeptChanging error for EUCLEAN.

Also report the condition explicitly in decrypt_credential_and_warn(),
like the other TPM2 unseal callers do.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Alberto Planas 941db14b8e cryptsetup,cryptenroll: report continuously changing PCRs explicitly
tpm2_unseal() returns -EUCLEAN specifically when a PCR kept being
extended while unsealing, but the unseal callers no longer catch it
via ERRNO_IS_NEG_TPM2_UNSEAL_BAD_PCR() and would fall back to the
generic "Failed to unseal secret using TPM2" message.

Give it a message of its own instead, so that the log points at the
actual cause instead of suggesting the system was tampered with.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Alberto Planas 2d54e6b56e tpm2-util: make -EUCLEAN from tpm2_unseal() mean "PCRs kept changing"
So far tpm2_unseal() used -EUCLEAN together with the errors that
signal that the PCR state does not match the policy.  That is
misleading: -EUCLEAN (and TPM2_RC_PCR_CHANGED) is only ever generated
when the TPM's global PCR update counter moves while we are building the
policy or unsealing, i.e. when something on the system extends a PCR
concurrentlyi (usually IMA extending PCR 10).  It says nothing about
whether the policy itself matches.

Until now the retry loop only recognized those conditions while retries
were left (i > 0), and once the budget was exhausted the last iteration
fell through to the generic paths, reporting either an unrelated policy
error or -ENOTRECOVERABLE.  Handle the last iteration explicitly instead,
and return -EUCLEAN with a message that names the actual problem.

Drop -EUCLEAN from ERRNO_IS_NEG_TPM2_UNSEAL_BAD_PCR(), it is not a "bad
PCR state" error.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2026-09-22 21:31:48 +02:00
Nandakumar Raghavan c99af7968e repart: add EncryptAddToken= to register custom LUKS2 tokens at provisioning time
Adds EncryptAddToken=<type>[:<source>:<value>] to repart.d partition
files, registering one or more LUKS2 token objects in the partition
header after the keyslot is created. This allows custom token plugins
(e.g. a TDX KBS plugin) to be wired up at provisioning time without a
separate cryptsetup token import step.

The type name is always explicit and extra token fields can be supplied as
a JSON file (:file:/path) or base64-encoded JSON (:data:<base64>). The
type and keyslots fields are always injected by repart. The option is
repeatable; an empty value clears all tokens for the partition.

Supported with Encrypt=key-file, tpm2, and key-file+tpm2.
2026-09-22 21:26:20 +02:00
Luca Boccassi 06c2dfa73c bless-boot: skip gracefully on kexec
If KExecsCount > 0 then do not attempt to mark a UKI, as the stub (and also
any addon and the bootloader) will not have been exercised, so there's no
guaranteed a full reboot with the same image will actually work.

Fixes https://github.com/systemd/systemd/issues/43738
2026-09-22 21:25:20 +02:00
Daan De Meyer f0f521c147 ci: only count line-anchored code fences in review comments
A triple backtick inside prose made the fence count odd, so a body with an
inline marker plus a valid suggestion block got cut at the block's closing
fence and left it open. Only fences at the start of a line delimit blocks,
so count and strip those alone.
2026-09-22 18:56:37 +02:00
Georg Müller 0827be05dd kbd-util: allow kmap as a valid suffix
debian is using kmap suffix in console-data and kbd accepts this too.
2026-09-22 16:43:50 +02:00
Daan De Meyer c549d00e9f ci: let the workflow drive the Claude review instead of a coordinator agent
Reviews keep hitting the 50 minute timeout. The coordinator agent that was
supposed to launch reviewers, watch the clock, stop stragglers, validate and
write the result does none of that reliably: reviewers get stopped and lose
their findings, foreground validators can't be stopped, deadlines get
overshot by minutes, and one leftover agent keeps the process alive until
the job fails. Piling more rules into its prompt hasn't helped.

Do the orchestration in the shell instead. Run one bounded claude invocation
per review lens in parallel under timeout(1), each returning its findings as
structured output, merge them with jq and run one bounded validator over the
candidates. A lens that times out is just reported as failed. The post job
builds the tracking comment from what it actually posted, so the model no
longer authors the summary or the review bookkeeping. Agents run from an
empty directory with all inputs outside it, so the sandbox keeps both the
checkout and the inputs read-only.
2026-09-22 16:22:13 +02:00
Luca Boccassi 9bf36a72b1 test-journal: Expand coverage of reader and storage edge cases (#43835)
Let's make sure that we have wider regression coverage:

1. Verify duplicate, empty, binary, and repeated fields are stored and
enumerated correctly
2. Exercise reader position invalidation after seeking and changing
matches
3. Check cursor, data, unique-field, and field-enumeration lifetime
semantics
4. Test journal opening and following across invalid files, file
descriptor ownership, renames, unlinks, polling, immutable files, forked
readers, etc, etc
2026-09-22 16:12:20 +02:00
Frantisek Sumsal efa16c7f31 dns-packet: limit the number of jumps during packet decompression
So far we didn't limit the number of jumps when decompressing a DNS
packet. This can lead to some extra work with specially crafted packets
that send a staircase of thousands of descending compression pointers,
which can then be amplified by referencing such staircase from thousands
of names.

Given that legitimate DNS packets need only a handful of jumps in the
compression chains, let's limit the number of jumps per a single name to
256 (the same limit as, for example, Unbound currently has).

Reported by opensec-intelligence (OpenSec).
2026-09-22 15:55:13 +02:00
Luca Boccassi 726cc309b4 NEWS: open new changelog 2026-09-22 15:12:10 +02:00
Luca Boccassi af6469a83c meson: switch version to 263~devel 2026-09-22 15:12:10 +02:00
Luca Boccassi 8cc40e0c5e Finalize meson.version for v262 2026-09-22 15:12:10 +02:00
Luca Boccassi b9979c1e1a NEWS: finalize 2026-09-22 15:12:10 +02:00
Luca Boccassi 2972f1f047 NEWS: update contributors list 2026-09-22 15:12:10 +02:00
Luca Boccassi 6859ecd916 hwdb: update rules 2026-09-22 15:12:10 +02:00
Zbigniew Jędrzejewski-Szmek 541b1335f5 Rename KExecsCount to KExecCount 2026-09-22 14:38:02 +02:00
Daan De Meyer cfd2f7c73e namespace-util: fail if we cannot become root when entering a userns
namespace_enter() tried to become root after joining a user namespace
but ignored failures, so if root wasn't mapped we'd just carry on with
our original UID/GID. Let's make that an error instead.

Dropping supplementary groups stays best effort, as setgroups() might
be denied (e.g. by the nsresourced BPF LSM) even when root is mapped.

Some callers do need to enter namespaces without root, so add
NAMESPACE_ENTER_KEEP_UID_GID_IF_ROOT_UNMAPPED for those. It's used by
systemd-analyze unit-shell and by the credential refresh in the user
manager. Everything else enters containers or namespaces we allocated
ourselves, where root is always mapped.
2026-09-22 13:48:24 +02:00
Zbigniew Jędrzejewski-Szmek 63a7cf844d NEWS: some tweaks before release
Introspection is implemented for everything that has a command-line
parser, not only for select binaries.

Standarize on "rate-limit" as the spelling in docs.

Various other smaller tweaks and clarifications.
2026-09-22 12:47:54 +02:00
Yu Watanabe 6a131b32e0 include: fix limits.h override
This is especially necessary since GCC 16.x.

=====
$ gcc --version
gcc (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=====

Without this change, /usr/include/limits.h is not included, hence POSIX
constants are not defined:
=====
$ echo '#include <limits.h>' | gcc -E -H -isystem ~/git/systemd/src/include/musl - 2>&1 >/dev/null | grep '^\..*limit'
. /home/watanabe/git/systemd/src/include/musl/limits.h
.. /usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h
... /usr/lib/gcc/x86_64-redhat-linux/16/include/syslimits.h
=====

With this change, /usr/include/limits.h is included, thus POSIX
constants are defined:
=====
$ echo '#include <limits.h>' | gcc -E -H -isystem ~/git/systemd/src/include/musl - 2>&1 >/dev/null | grep '^\..*limit'
. /home/watanabe/git/systemd/src/include/musl/limits.h
.. /usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h
... /usr/include/limits.h
...... /usr/include/linux/limits.h
.. /usr/lib/gcc/x86_64-redhat-linux/16/include/limits.h
=====

Replaces #43824.
2026-09-22 18:14:12 +09:00
Chris Down 532ee29e62 test-journal: Cover journal open and follow edge cases 2026-09-22 15:00:55 +08:00
Chris Down 8239be1d10 test-journal: Cover cursor and data lifetime 2026-09-22 15:00:55 +08:00
Chris Down 422abe6be6 test-journal: Cover reader position invalidation 2026-09-22 15:00:55 +08:00
Chris Down 5d49a06cab test-journal: Cover duplicate entry storage 2026-09-22 15:00:55 +08:00
Yu Watanabe e362a4efcb namespace,condition: drop invalid _const_ attributes
The _const_ attribute can be only used for functions.

Fixes the following warnings on Fedora rawhide:
```
../src/core/namespace.h:260:75: warning: '__const__' attribute only applies to functions [-Wignored-attributes]
  260 | char* bpf_delegate_to_string(uint64_t u, const char * (*parser)(uint64_t) _const_);
      |                                                                           ^
../src/basic/../fundamental/macro.h:80:32: note: expanded from macro '_const_'
   80 | #define _const_ __attribute__((__const__))
      |                                ^
In file included from ../src/core/unit.c:24:
../src/shared/condition.h:87:63: warning: '__const__' attribute only applies to functions [-Wignored-attributes]
   87 | typedef const char* (*condition_to_string_t)(ConditionType t) _const_;
      |                                                               ^
../src/basic/../fundamental/macro.h:80:32: note: expanded from macro '_const_'
   80 | #define _const_ __attribute__((__const__))
      |                                ^
```
2026-09-22 02:46:35 +09:00
Val Packett d4f1a76a2e udev: rules: order ID_BUS assignment by specificity / bus nesting depth
Only PCI was treated as a "less specific" bus that should not be
assigned if USB was already assigned, so non-PCI USB controllers
(under platform/DT or ACPI) would have all their devices *not*
treated as USB at all, resulting in external peripherals being
treated as internal ones on DT platforms.

Clarify these assignments into specificity/nesting groups instead
of having some arbitrary "X must be before Y" comments.

Fixes a4381cae8b.
2026-09-21 23:46:17 +09:00
Lennart Poettering e355960ac1 Various imds fixes (#43772) 2026-09-21 13:58:58 +02:00
Yu Watanabe a6653a56c9 test-network: do not try to set too small quanta for ets
Since kernel v7.3 the kernel clamp quanta:
https://github.com/torvalds/linux/commit/1c38487f46b243bfeefec0c0c86023a3904f2214

So, too small values are now calmped to 256.
Let's change the values used in the test so that they are not clamped.
2026-09-21 13:31:06 +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
Luca Boccassi 5d414df040 NEWS: drop truncated sentence 2026-09-21 11:17:45 +02:00
zouge666 07cf0376a8 dissect-image: prevent start+size LBA overflow 2026-09-21 10:10:22 +02:00
Jan Kuparinen e96ff3b5b9 po: Translated using Weblate (Finnish)
Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fi/
Translation: systemd/main
2026-09-19 05:16:58 +09:00
Weblate Translation Memory 96347f83cc po: Translated using Weblate (Finnish)
Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

po: Translated using Weblate (Finnish)

Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fi/
Translation: systemd/main
2026-09-19 05:16:58 +09:00
Anders Jonsson a269dda363 po: Translated using Weblate (Swedish)
Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Anders Jonsson <anders.jonsson@norsjovallen.se>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main
2026-09-19 05:16:58 +09:00
Daan De Meyer 477a4c97e0 ci: shorten Claude review comments and raise the bar on re-reviews
The Claude review workflow posted long, padded inline comments, and every
force push produced a fresh batch of new findings on code that had not
changed. Both make authors stop reading the reviews.

Add a comment style section to the prompt that limits each comment to the
problem and the obvious fix, and truncate anything over 1000 characters in
the post job. Track the number of completed reviews and the last reviewed
head in a hidden state line in the tracking comment. Each successful review
narrows the severities that may be posted: everything on the first review,
no nits on the second, and only must-fix findings from the third on. The
post job enforces the policy so it holds even if the model ignores the
prompt, and reviewers are told to range-diff against the previous head and
skip non-must-fix findings on unchanged code. Commenting "@claude review
full" resets the count for that run.
2026-09-18 20:28:35 +02:00
Lennart Poettering 41bf07afe1 man: add missing = 2026-09-18 20:23:00 +02:00
Zbigniew Jędrzejewski-Szmek 4fb9fbd68a man,doc: fix typos (#43766) 2026-09-17 20:41:37 +02:00
Zbigniew Jędrzejewski-Szmek a2b81310af test: give the D-Bus reconnect checks their own integration test (#43776)
`TEST-23-UNIT-FILE.dbus-reconnect.sh` SIGKILLs `dbus.service` three
times. Nothing reconnects to the new broker, so logind keeps running
with `org.freedesktop.login1` unowned for the rest of the boot —
activation can't fix it either, as `dbus-org.freedesktop.login1.service`
is already active, so the job finishes at once and the name never
returns.

That leaks into the subtests after it. `statedir.sh`, the first to start
`user@0.service`, spends 2 × 25 s in user-runtime-dir on logind
properties, and where pam_systemd can't use Varlink (memory-max= & co.
in the PAM stack) it blocks in `CreateSession()` for 2 min, past
user@.service's 90 s TimeoutStartSec — failing, and pointing at a
subtest that has nothing to do with the bus.

Hit this in hyperscale v261.3 release test for centos9:

https://artifacts.dev.testing-farm.io/01c1c68b-da64-4b9e-b163-eb3459aabe79/work-upstreamjejyd7ep/log.txt
2026-09-17 15:38:16 +02:00
Ivan Kruglov d4d31c1859 test: exempt the broker from its start rate limit in TEST-95 2026-09-17 04:51:36 -07:00
Ivan Kruglov 621df84009 test: give the D-Bus reconnect checks their own integration test
Killing the broker is destructive well beyond the units under test: nothing
reconnects to the new one, so logind for instance keeps running with
org.freedesktop.login1 unowned for the rest of the boot. As a subtest of
TEST-23-UNIT-FILE that leaked into everything running after it, and
statedir.sh, the first one to start user@0.service, then spent 25s per logind
property in user-runtime-dir and, where pam_systemd can't use Varlink, blocked
in CreateSession() past user@.service's 90s TimeoutStartSec and failed — with
the failure pointing at a subtest that has nothing to do with the bus.

In its own test the damage dies with the machine.
2026-09-17 04:51:29 -07:00
Daniel Wagenknecht d8b9dacaf9 timedate: use SymlinkFlags enum members for flags
The flags to pass to symlinkat_atomic_full are defined in the
SymlinkFlags enum type. The previous code passed the result of a boolean
check operation directly instead of using flags.

Be explicit about the value to pass instead of relying on true
corresponding to the enum value for the SYMLINK_MAKE_RELATIVE flag.

Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
2026-09-17 13:00:17 +02:00
Yu Watanabe b36cf41a89 README.md: fix invalid </br> tags in badge list 2026-09-17 11:49:45 +09:00
Yu Watanabe 24de80f596 docs: fix typos and grammar in NEWS, README and TODO 2026-09-17 11:49:45 +09:00
Yu Watanabe 496712eddc docs: fix typos and grammar in various documents 2026-09-17 11:49:45 +09:00
Yu Watanabe 194c72b37f man: fix parameter controlling activatable names query for sd_bus_list_names()
The second conditional checked "acquired", but the ListActivatableNames
call is governed by the "activatable" argument.
2026-09-17 11:49:45 +09:00
Yu Watanabe 83c4191e25 man: fix inverted -ENODATA description for sd_bus_message_get_reply_cookie()
-ENODATA is returned when the message carries no (reply) cookie, but the
text stated the message "carries a reply cookie field". Say it does not
carry one.
2026-09-17 11:49:45 +09:00
Yu Watanabe 8787df83fe man: several fixlets for documentation of sd_bus_message_read_array()
- It does not accept NUL for type.
- ret_size is zero and ret_ptr is non-NULL when it returns positive.
- Fixed argument names: ptr -> ret_ptr, size -> ret_size.
2026-09-17 11:49:45 +09:00