Commit Graph
87418 Commits
Author SHA1 Message Date
Lennart Poettering eb6e5b07f1 imds: add new systemd-imdsd.service that makes IMDS data accessible locally
This service's job is to talk to a VM associated IMDS service provided
by the local Cloud. It tries to abstract the protocol differences
various IMDS implementations implement, but does *not* really try to
abstract more than a few basic fields of the actual IMDS metadata.

IMDS access is wrapped in a Varlink API that local clients can talk to.

If possible this makes use of the IMDS endpoint information that has
been added to hwdb in the preceeding commit. However, endpoint info can
also be provided via kernel command line and credentials. For debugging
purposes we also accept them via environment variables and command line
arguments.

This adds a concept of early-boot networking, just enough to be able to
talk to the IMDS service. It is minimally configurable via a kernel
cmdline option (and a build-time option): the user may choose between
"locked" and "unlocked" mode. In the former mode direct access to IMDS via
HTTPS is blocked via a prohibit route (and thus all IMDS communication
has to be done via systemd-imdsd@.service). In the latter case no such
lockdown takes place, and IMDS may be acquired both via this new service
and directly. The latter is typically a good idea for compatibility with
current systems, the former is preferable for secure installations.

Access to IMDS fields is controlled via PK.
2026-03-26 10:54:15 +01:00
Lennart Poettering f3eac272e6 hwdb: add database for basic IMDS properties
This adds a hardware database that contains information about IDMS
functionality of various clouds, keyed off the SMBIOS identification of
each. Currently this contains information about 6 major clouds, but the
idea is that this grows to include more and more major clouds.

Nothing uses this data yet, that's added in a later commit.
2026-03-26 10:54:15 +01:00
Daan De Meyer 211cd6e9a3 ci: Add subject_type to createReviewComment()
Apparently this is required by the createReviewComment() API.
2026-03-26 10:18:13 +01:00
Daan De Meyer db3ace5da5 ci: Use path instead of file in claude-review prompt as JSON key
In https://github.com/systemd/systemd/pull/40980 claude hallucinated
and used "path" instead of "file" as the JSON key. Since "path" is
arguably more correct than "file" anyway, let's switch to that.
2026-03-26 10:18:13 +01:00
Luan Vitor Simião Oliveira 7d320c3a99 hwdb: Add PXN HB S handbrake
otherwise, it is not classified.
reports 2 axes and 2 buttons although only 1 is actually used.
2026-03-26 08:35:33 +01:00
Lennart Poettering b45068d45a two small resolved fixups (#41337) 2026-03-26 08:33:49 +01:00
Patrick Wicki 6c7e5b81ac tpm2-util: fix PCR bank guessing without EFI
Since 7643e4a89 efi_get_active_pcr_banks() is used to determine the
active PCR banks. Without EFI support, this returns -EOPNOTSUPP. This in
turns leads to cryptenroll and cryptsetup attach failures unless the PCR
bank is explicitly set, i.e.

$ systemd-cryptenroll $LUKS_PART --tpm2-device=auto --tpm2-pcrs='7'
[...]
Could not read pcr values: Operation not supported

But it works fine with --tpm2-pcrs='7:sha256'.

Similarly, unsealing during cryptsetup attach also fails if the bank
needs to be determined:

Failed to unseal secret using TPM2: Operation not supported

Catch the -EOPNOTSUPP and fallback to the guessing strategy.

Signed-off-by: Patrick Wicki <patrick.wicki@subset.ch>
2026-03-25 23:18:58 +01:00
Massii Aqvayli 91af485544 po: Translated using Weblate (Kabyle)
Currently translated at 36.4% (97 of 266 strings)

Co-authored-by: Massii Aqvayli <massiin@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/kab/
Translation: systemd/main
2026-03-25 22:18:04 +00:00
Lennart Poettering b734340596 resolved: move resetting of {etc_hosts|static_records}_last to manager_dispatch_reload_signal()
This addresses
https://github.com/systemd/systemd/pull/41213#pullrequestreview-4002247053
which I somehow missed earlier.

Claude found a real issue for the case of manager_etc_hosts_flush().
We'll do the equivalent change in manager_static_records_flush() too,
even though it's not really necessary there, simply to keep things
nicely mirrored.
2026-03-25 23:06:03 +01:00
Lennart Poettering 7863f6ba85 resolved: fix typo in comment 2026-03-25 23:06:03 +01:00
Daan De Meyer 8ff77aac13 vmspawn: Use qemu config files
Let's avoid generating giant qemu command lines by using qemu config
files instead.
2026-03-25 22:12:54 +01:00
Daan De Meyer f83371324d vmspawn: Create journal parent directories if needed 2026-03-25 21:55:19 +01:00
Daan De Meyer 5442fbfb07 vmspawn: Fix --tpm-state= parsing
path_startswith() considers "no" and "./no" equal. Use startswith()
to avoid that.
2026-03-25 21:54:51 +01:00
Mike Yuan aa71035a20 meson: detect availability of attributes using cc.has_function_attribute()
Alternative to fabc22f599

As suggested in https://github.com/systemd/systemd/pull/41174#discussion_r2966411375
2026-03-25 21:54:21 +01:00
Mike Yuan f3d385da2a memory-util: avoid passing invalid pointer to memcmp() when length == 16
If length is exactly 16, the loop would finish with length == 0,
but we'd carry on to the memcmp() check, where the 'p + 16' passed
would be invalid memory. memcmp() demands valid pointers even if
size is specified to 0, hence let's catch this ourselves.
2026-03-25 21:49:04 +01:00
Daan De Meyer 247ef81b6f swtpm: Properly configure state directory (#41322) 2026-03-25 20:21:16 +01:00
Daan De Meyer e2cfdfff15 AGENTS: Tell agents to not use mkosi box
It's easier to run the AI tool within mkosi box rather than telling
it to use mkosi box and forgetting to use it half the time.
2026-03-25 18:26:09 +01:00
Lennart Poettering 7a3f18d41d sd-stub: support for a "boot secret" stored in a EFI variable, as a fallback for TPM-less systems (#41217)
Split out of #41016
2026-03-25 18:24:07 +01:00
Lennart Poettering dcad61c74d stub: introduce "boot secret" stored in an EFI variable inaccessible to the OS 2026-03-25 16:19:27 +01:00
Lennart Poettering 6dc6b48ec9 random-seed: when we have a reasonable RNG then create random seed file if missing
Previously we'd never write the ESP random seed file (or initialize the
random seed EFI table) if it didn't already exist. Let's adjust this a
bit, and also create it fresh if we have a "good" random source, i.e. if
the EFI table already existed or if the RNG protocol is implemented by
EFI.

This is useful as it increases the chance the random seed table is
valid, and we can use it as source for randomness in later stages.
2026-03-25 16:19:24 +01:00
Daan De Meyer 82d69529cb swtpm-util: Write our own CA options rather than using the distro ones 2026-03-25 15:34:58 +01:00
Daan De Meyer 901024eea1 swtpm: Properly configure state directory
Otherwise it will unconditionally try to use /var/lib/xxx which won't
work when running unprivileged.
2026-03-25 15:22:57 +01:00
Lennart Poettering 9b15ddd9cf random-seed: move seed efi table definitions to header 2026-03-25 14:50:19 +01:00
Lennart Poettering c678b0b060 efi: add efivar_get_raw_full() flavour that returns the variable attributes too 2026-03-25 14:50:19 +01:00
Lennart Poettering e7b3a7bb24 memory-util: move memeqbyte() & friends to src/fundamental/ 2026-03-25 14:50:19 +01:00
Luca Boccassi 7e37e01768 two small prep commits from the imds PR (#41316)
They are not directly IMDS stuff, and should be easy to merge ahead.
2026-03-25 12:54:23 +00:00
Hadi Chokr 21bfad87e4 Add condition for mutable extensions directory
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
2026-03-25 12:36:44 +01:00
Michael Vogt 9f691ad3c0 varlink: comment that "more" flag IDL comment is API
External tools that use the systemd varlink ecosystem require
to know if a specific varlink method supports/requires the
"more" flag from the IDL. This is tracked upstream in
https://github.com/varlink/varlink.github.io/issues/26

As an intermediate step systemd adds the (very nice) comments
```
 # [Requires 'more' flag]
or
 # [Supports 'more' flag]
```
to the various methods.

This commit extends the comment around the code that adds the
comment to clarify that this should be considered API and that
the comment should not be changed as external tools (like e.g.
the varlink-http-bridge) rely on it.
2026-03-25 12:27:50 +01:00
Lennart Poettering 588c22b04d macro.h: move DEFER_VOID_CALL() to cleanup-util.h
For some reason the IMDS PR for the first time triggers an issue with
the DEFER_VOID_CALL() logic relying on assert() and being places in
macro.h, let's hence move this elsewhere.
2026-03-25 11:52:33 +01:00
Lennart Poettering 16a3857dcf test-iovec: add unit test for IOVEC_MAKE_BYTE()
As requested here: https://github.com/systemd/systemd/pull/40980#discussion_r2964650885
2026-03-25 11:52:33 +01:00
Zbigniew Jędrzejewski-Szmek 66feeea8e1 A batch of conversions to the new options parsers (#41302)
This was partially done with Claude, but it needed an insane amount of prodding to
not do stupid things.
2026-03-25 11:39:36 +01:00
Walter McKelvie 8ddc1c07f6 network: increase transmit/receive queues size to 16384 (#41289)
A 10G Marvell AQC113 included in an ASRock TRX50WS motherboard NIC claims to
support tx/rx queues as large as 8184.

After boot 'ethtool -g eth0' outputs:
  Ring parameters for eth0:
  RX:			8184
  RX Mini:		n/a
  RX Jumbo:		n/a
  TX:			8184
  TX push buff len:	n/a
  HDS thresh:		n/a
  RX:			2048
  RX Mini:		n/a
  RX Jumbo:		n/a
  TX:			4096
  RX Buf Len:		n/a
  CQE Size:		n/a
  TX Push:		off
  RX Push:		off
  TX push buff len:	n/a
  TCP data split:		n/a
  HDS thresh:		n/a

'ethtool --set-ring eth0 rx 8184 tx 8184 && ethtool -g eth0' yields:
  Ring parameters for eth0:
  RX:			8184
  RX Mini:		n/a
  RX Jumbo:		n/a
  TX:			8184
  TX push buff len:	n/a
  HDS thresh:		n/a
  RX:			8184
  RX Mini:		n/a
  RX Jumbo:		n/a
  TX:			8184
  RX Buf Len:		n/a
  CQE Size:		n/a
  TX Push:		off
  RX Push:		off
  TX push buff len:	n/a
  TCP data split:		n/a
  HDS thresh:		n/a

I can measure a throughput difference between using using buffer sizes
4096 and 8184 on my hardware, so it really seems that this is doing
something beyond buggy firmware.

Original PR https://github.com/systemd/systemd/pull/17635 didn't give any
explanation for the limit of 4096, but that's probably what was supported by
the kernel drivers at the time.

A web search shows that CISCO VIC 15000 supports 16k, so allow up to that.

[zjs: edited the message]
2026-03-25 11:37:31 +01:00
Ronan Pigott 27eedfa0ef resolved: use the SOA to find chain of trust quicker
sd-resolved does dnssec "backwards" compared to most resolvers.

A typical strategy is to start from the DNS root and gather the
requisite keys on the way down, but sd-resolved requests the final
answer it wants and then goes searching for the requisite keys later.

We don't know in advance under which names we should expect to find
those keys, because we don't know the zone cuts a priori, but we can use
what we have found in prior responses to make an educated guess. This
was more or less the intent of 47690634f1, but it was partially
regressed in d840783db5 while fixing a bug handling totally empty
responses.

Fixes #37472

Ref: 47690634f1 ("resolved: don't request the SOA for every dns label")
Fixes: d840783db5 ("resolved: always progress DS queries")
2026-03-25 11:32:51 +01:00
Frantisek Sumsal f912de9312 homectl: apply all --member-of= groups from a comma-separated list
Commit 0e1ede4b4b introduced a bug where
we'd always fetch the "original" (empty) list of groups when processing
a comma-separated list of groups from the --member-of= option, so only
the last group from the list would get applied. This bug was then later
(in 316e9887f2) refactored into a separate
function.

Follow-up for 0e1ede4b4b.
Resolves: #41286
2026-03-25 10:41:06 +01:00
Zbigniew Jędrzejewski-Szmek 2e31b9eb29 resolved: resolve insecure answers with unsupported sig algorithms (#40778)
sd-resolved does not support all the permissible DNSSEC signature
algorithms, and some are intentionally unsupported as a matter of
policy. Answers that can only be validated via unsupported algorithms
should be treated as if they were unsigned, per RFC4035 § 5.2.

Previously, sd-resolved tried to properly record insecure answers for
unsupported algortihms, but did not record this status for each of the
auxilliary DNSSEC transactions, so the primary transaction had no way to
know if there was a plausible DNSKEY with an unsupported signature
algorithm in the chain of trust.

This commit adds the insecure DNSKEYs that use unsupported algorithms to
the list of validated keys for each transaction, so that dependent
transactions can learn that a plausible chain of trust exists, even if
no authenticated one does, and report the insecure answer.

This should improve the situation in #35126.
2026-03-25 10:38:08 +01:00
Zbigniew Jędrzejewski-Szmek 9e8658b887 various: fix typos 2026-03-25 02:03:56 +01:00
Zbigniew Jędrzejewski-Szmek cad2dca504 bless-boot: use the new option parser and verb macros
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 02:03:55 +01:00
Zbigniew Jędrzejewski-Szmek baae6e9476 shared/verbs: add VERB_COMMON_HELP_HIDDEN macro and skip verbs with NULL help
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 02:03:49 +01:00
Zbigniew Jędrzejewski-Szmek 7be9bb1845 shared/verbs: allow multiple verbs to be handled by a single function
With the uintptr_t data parameter, it is actually quite nice to have
VERB(do_impl, "name-a", …)
VERB(do_impl, "name-b", …)
int do_impl(…) { … }

To make this work, the do_impl_data struct needs to have a unique name and
we also need to suppress the warning about the forward declaration for
do_impl being repeated. I think it's fine to suppress the warning, it's
not needed for anything. If somebody declares the function with the same
name by mistake, the implementations are going to conflict too.
2026-03-25 02:02:25 +01:00
Zbigniew Jędrzejewski-Szmek ca6c3bd0e5 validatefs: shorten and reindent code 2026-03-25 02:02:24 +01:00
Zbigniew Jędrzejewski-Szmek 34d08e2ec3 validatefs: use the new option parser
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 02:02:24 +01:00
Zbigniew Jędrzejewski-Szmek 58e891e5f6 update-done: use the new option parser
While at it, add --version.

Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 02:02:23 +01:00
Zbigniew Jędrzejewski-Szmek 6e2c5624e6 ask-password: use the new option parser
--version was missing from the old help text and is now included.

Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 02:02:22 +01:00
Zbigniew Jędrzejewski-Szmek 9a96415c69 shared/options: allow option help to be extended with fake lines
Useful when we want to enumerate options rvalues with custom help
texts.
2026-03-25 02:02:20 +01:00
Zbigniew Jędrzejewski-Szmek 1ccfe9ec5f binfmt: use the new option parser
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 00:45:57 +01:00
Zbigniew Jędrzejewski-Szmek 0765919f05 shared/options: add common option macros for --cat-config and --tldr
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 00:45:57 +01:00
Zbigniew Jędrzejewski-Szmek 9b8d74a4e7 ac-power: use the new option parser
Co-developed-by: Claude <claude@anthropic.com>
2026-03-25 00:45:57 +01:00
Zbigniew Jędrzejewski-Szmek 848dd000e0 shared/options: add helper function to count positional args 2026-03-25 00:45:57 +01:00
Lennart Poettering 4b6893bdc8 resolved: add "static RRs" concept (#41213)
split out of #40980
2026-03-24 22:45:22 +01:00
Daan De Meyer 4c02d63b36 vmspawn: Fix --help width 2026-03-24 22:43:44 +01:00