Commit Graph
1372 Commits
Author SHA1 Message Date
dongshengyuan d73f3879f0 repart: drop legacy FactoryReset EFI variable
Follow-up for 9e050b0458.
2026-07-28 19:51:45 +09:00
Chris Coulson f0f3687700 tpm2: Improve how NvPCR protection works.
NV indexes created in the storage hierarchy can be undefined and
redefined with TPM owner auth. Because of this, NvPCRs need some way
to prevent them from being redfined in a way that allows spoof
measurements to be replayed.

The current approach requires knowledge of a secret ("anchor secret")
in order to derive the initial NvPCR measurement and to derive a
measurement to an existing PCR (9). The credential is protected by the
TPM with a PCR policy. Without access to the credential, it's not
possible to replay measurements to a newly defined NvPCR without
breaking the binding with the measurement in PCR 9. However, this
approach has a couple of issues:

- The credential is currently only protected by PCR11. As it's not
  protected by the rest of the boot chain, it's possible to boot other
  operating systems in order to replay the PCR11 measurements and
  recover the secret. Note that as the NvPCR anchoring happens in early
  boot, the credential is stored in the ESP.
- Someone with privileged access to a system can just create a new
  credential containing a known secret and store this in /var/lib and
  the ESP. The NvPCRs are anchored with this known secret on subsequent
  boots, and therefore the measurements can no longer be trusted.
  Imagine the scenario where privileged access is theoretically possible
  as a result of some vulnerability. After upgrading the system to fix
  this vulnerability, the system should be able to attest that it is
  now in a good state. However, if an adversary were able to use their
  priviliges to replace the credential, they are able to obtain
  persistence and the NvPCR measurements are no longer trustworthy.

This PR changes things to take a different approach. Instead of
requiring knowledge of a secret, the NvPCRs are now created in a way
that requires a policy to be satisfied for writing. The write policy has
2 branches:
- TPM2_PolicyNvWritten(true), which can be satisified without any
  further authorization if the NvPCR has already been extended.
- TPM2_PolicyAuthorize(pcrPubKey, SHA256("nvpcr-init")) which can be
  satisfied with a signed PCR policy, and must be used to perform the
  initial extend to a NvPCR.

The intention here is that the signed PCR policy that can be used to
authorize the initial extend to the NvPCR can only be satisfied during
early boot. During later boot phases, this signed PCR policy must not be
valid. This means that if a NvPCR is undefined and redefined, it won't
be possible to satisfy its write policy in order to able to perform the
initial extend.

In order to anchor the NvPCRs and prevent them from being undefined and
then redefined with a different policy that does allow them to be
extended, the names of the NvPCRs are measured to PCR9. Verifiers must
check that the names of attested NvPCRs match the measurements in PCR9.

This uses the PCR signing key from the currently booted UKI to create
the NvPCRs. If this changes between boots, then tpm2-setup automatically
recreates new NvPCRs with an updated write policy to reflect this. I've
tried to be careful to not undefine arbitrary NV indexes in this case,
so it checks that the existing NV index looks like a NvPCR (ie, it has
the expected attributes) before undefining it.

I did originally try to preserve the old behaviour for existing systems,
but it makes things a lot more complicated. As the new implementation
already creates new NvPCRs when the PCR signing key changes, I ended up
just automatically upgrading the old NvPCRs as well. Again, I check here
that any existing NV index looks like an old style NvPCR (ie, it has the
expected attributes) before undefining it.

I did notice that the initial NvPCR measurement isn't going into the
log. I don't know if that was an intentional choice, but I've preserved
that behaviour in this PR.

This also adds a new option to ukify (--sign-initrd-pcrs) which creates
signed policies (one per PCR bank) that can only be satisfied from the
initrd. These policies are used for initializing the NvPCRs, but can also
be used for protecting TPM2 keyslots enrolled with systemd-cryptenroll
(by using the --tpm2-public-key-policyref=initrd option).

There is one outstanding issue. The NvPCR definitions support different
algorithms, but the use of PolicyAuthorize means that they can only support
SHA-256 for now. This is because the signed policy algorithm must match
the name algorithm, and some additional work is required to support
signed PCR policies for algorithms other than SHA256. I've left a note in
tpm2_nvpcr_initialize that details what's required, and I'll take a look
at that in a subsequent PR.
2026-07-28 08:35:39 +02:00
Yu Watanabe 20ef89f646 NEWS: mention the removeal of legacy udev control socket 2026-07-18 05:29:59 +09:00
Aritra Basu 08bebda611 network: add IPv4ProxyARPAddress= and consolidate proxy ARP/NDP handling
This adds an IPv4 counterpart to `IPv6ProxyNDPAddress=` for adding
manual entries to the kernel's IPv4 neighbour proxy table (check via
`ip -4 neighbour show proxy dev <dev>`). systemd-networkd only exposed
`IPv4ProxyARP=` for per-interface `proxy_arp` sysctl (automatic proxy
ARP) with no way to manage manual entries from a .network file.

To avoid duplicating the IPv6 proxy NDP code path, both families are
now combined into a single new `networkd-neighbor-proxy` module. The
IPv6 behaviour is preserved: `IPv6ProxyNDPAddress=` still implies
`IPv6ProxyNDP=yes` unless `IPv6ProxyNDP=` is explicitly disabled and
entries are still dropped if the kernel has no IPv6 support.
The same rule is applied to `IPv4ProxyARPAddress=`. It implies
`IPv4ProxyARP=yes` when the sysctl is not explicitly set and has no
effect if `IPv4ProxyARP=` has been set to false.

This keeps the user model symmetric and predictable across both
families: a single per-address setting that turns on the matching
per-interface sysctl automatically, while still letting system
administrators opt out by setting the boolean explicitly to false.

Note that the IPv4 manual NTF_PROXY entries installed here would
actually function without `proxy_arp` (unlike IPv6, where `proxy_ndp`
gates the manual entries); the implication is kept for symmetry with
`IPv6ProxyNDPAddress=` and is now called out explicitly in the man
page, together with the fact that enabling `proxy_arp` also activates
interface-wide automatic proxy ARP for routed-toward addresses on
connected subnets.

Parser-time validation rejects addresses the kernel would refuse:
the ANY/null address for both families, IPv4 and IPv6 multicast
and the IPv4 limited broadcast 255.255.255.255.

Signed-off-by: Aritra Basu <aritrbas+gh@cisco.com>
2026-07-16 01:23:40 +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
Zbigniew Jędrzejewski-Szmek 833b8d98e0 NEWS,README: describe embedded files and static linking 2026-07-02 17:19:18 +02:00
Michael Vogt 896fd702ba firstboot: add new systemd.firstboot=headless mode
This adds a new systemd.firstboot=headless mode. It differs from the
existing systemd.firstboot=no mode in that it still performs the
non-interactive auto-configuration that requires no user input (such
as selecting the only installed locale, or applying settings provided
via credentials), and only skips the prompts that would otherwise
block waiting for user input. In contrast, =no disables that
auto-configuration along with the prompts.

The option is also honoured by homectls firstboot logic and
systemd-cryptenroll, where headless behaves the same as no
(because the is no auto-configuration).
2026-07-02 09:52:21 +01:00
Philip Withnall 2d201a107b sysupdate: Add basic varlink interface scaffolding
This adds the scaffolding for being able to call sysupdate via varlink,
but it doesn’t yet define or implement any methods. Those will come in
following commits.

The existing `systemd-sysupdate.service` and `systemd-sysupdate.timer`
(which periodically ran `systemd-sysupdate update`) have been renamed
to `systemd-sysupdate-update.{service,timer}` to make way for a new
`systemd-sysupdate@.service` and `systemd-sysupdate.socket` file to
handle varlink activation.

Compatibility symlinks have been added for them.
2026-06-26 13:01:31 +01:00
Kai Wohlfahrt 9028d3a778 Add NEWS entry
This is a breaking change, even if it is unlikely that anyone is relying
on it.
2026-06-22 10:39:36 +02:00
Luca Boccassi 7dd5ddcb18 NEWS: finalize 2026-06-19 19:08:35 +01:00
Luca Boccassi 24893c78e8 NEWS: update contributors list 2026-06-19 19:08:35 +01:00
Lennart Poettering 436fc02bc8 update NEWS 2026-06-19 11:49:43 +02:00
Luca Boccassi 8170156f29 NEWS: update time and place 2026-06-16 17:57:06 +01:00
Luca Boccassi febb547335 NEWS: update contributors list 2026-06-16 17:57:06 +01:00
Luca Boccassi 89d9e055d2 NEWS: finalize place and date 2026-06-04 11:26:26 +01:00
Luca Boccassi 69a44b2944 NEWS: update contributors list 2026-06-04 11:26:05 +01:00
Daan De Meyer c0400c8b2e NEWS: Extend note about systemd-sysext refresh changes
Fixes #41523
2026-06-03 15:20:27 +01:00
Luca Boccassi 787a048612 Update NEWS 2026-06-03 15:05:59 +01:00
Luca Boccassi 5fd0150f28 NEWS: finalize date 2026-05-26 21:52:59 +01:00
Luca Boccassi b998590a3d NEWS: update contributors list 2026-05-26 21:52:23 +01:00
Yu Watanabe 6a9d22a89d NEWS: fix typo 2026-05-26 23:49:23 +09:00
Luca Boccassi 084488a39b Update NEWS 2026-05-24 12:59:52 +01:00
Daan De Meyer ecd9f71614 NEWS: Add note that libsystemd may not link to libm anymore 2026-05-24 12:55:25 +01:00
Zbigniew Jędrzejewski-Szmek 269fd06246 NEWS: drop imagined --print-profiles option
In dc91cb82da --print-profiles is
passed to swtpm_setup, that's it.
2026-05-22 18:37:56 +02:00
Lennart Poettering 13176da69c update NEWS a bit more for v261 2026-05-22 17:10:12 +02:00
Luca Boccassi aac7e559e7 NEWS: finalize date and time 2026-05-22 14:20:46 +01:00
Luca Boccassi 6d840290f4 NEWS: list contributors 2026-05-22 14:20:10 +01:00
Luca Boccassi 84e1fc304e Update NEWS 2026-05-22 14:18:26 +01:00
Luca Boccassi b256396e2a Update NEWS 2026-05-21 21:59:17 +01:00
Luca Boccassi 818397761e Update NEWS 2026-05-21 21:49:22 +01:00
Luca Boccassi 2b8ba0e05a Update NEWS 2026-05-21 21:13:10 +01:00
Luca Boccassi 9f016b3810 Update NEWS 2026-05-21 16:05:52 +01:00
Yu Watanabe 51120d1d31 NEWS: mention new DHCP relay agent 2026-05-21 16:55:59 +09:00
Yu Watanabe 6a35ae68cb NEWS: mention bump of musl requirement 2026-05-21 05:06:35 +09:00
Yu Watanabe 0fb82954ef udev: predictable names for auxiliary sub-function (SF) devices (#42154)
Some drivers (currently mlx5_core) expose sub-functions (SFs) of a PCI
Physical or Virtual Function as auxiliary devices that carry a stable
`sfnum` sysfs attribute (the user-defined SF number passed to `devlink
port add ... sfnum N`). Their leaf devices (net, infiniband, ...)
currently inherit the parent PF/VF's `ID_PATH` and the SF netdev falls
through to the kernel-assigned `eth<N>` name.

Two patches:

1. `udev-builtin-path_id`: prepend an `sf-<N>` token when the walk
crosses an aux device with `sfnum`, so SF leaf devices get an `ID_PATH`
distinct from the parent PF/VF (e.g. `pci-0000:c1:00.0-sf-88`). Aux
devices without `sfnum` keep the pre-patch behaviour, so existing
`ID_PATH` values are unchanged and the patch needs no naming-scheme gate
(path_id is unversioned).

2. `udev-builtin-net_id`: name SF host netdevs analogously to SR-IOV VF
host netdevs — walk to the parent PCI function and append a
single-character `S<sfnum>` suffix. SFs hosted on SR-IOV VFs (VF-SF) get
both suffixes chained on the PF's base name (`enp193s0f0v0S88`). Gated
behind `NAMING_SUBFUNC` / `NAMING_V261`. Man page
(`systemd.net-naming-scheme(7)`) updated.

The patches apply to any driver that exposes its SF leaf devices below
an aux device exposing `sfnum`.

Validated on mlx5 hardware: PF, VF, SF-on-PF (`enp8s0f0S88`,
`pci-0000:08:00.0-sf-88`). VF-SF case verified with a fake-sysfs setup
since this is not supported by any real device and is more a theoretical
use case.
2026-05-20 03:33:15 +09:00
Luca Boccassi fed82f2a68 Update NEWS 2026-05-19 14:56:24 +01:00
Jiri Pirko 48afde6751 NEWS: mention auxiliary sub-function (SF) network device naming
Document user-visible effect of the new NAMING_SUBFUNC / v261 scheme.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 14:51:51 +02:00
Lennart Poettering 86e74db277 some NEWS fixed by Claude 2026-05-19 14:35:29 +02:00
Lennart Poettering 6695167aea update TODO 2026-05-19 13:20:39 +02:00
Lennart Poettering 9a8e2f17ef update NEWS 2026-05-18 23:43:27 +02:00
Lennart Poettering 606698ec74 update NEWS 2026-05-18 23:17:50 +02:00
Jörg Behrmann 5d5483156d NEWS: typo fixes 2026-05-18 14:28:05 +01:00
Luca Boccassi 06960c11b3 NEWS: add new items for v261~rc1 2026-05-18 11:52:25 +01:00
Yu Watanabe ddd535a424 NEWS: mention new 'networkctl dhcp-lease' command 2026-05-17 21:03:55 +09:00
Diego Viola 5d17215c7e treewide: fix typos in the entire codebase
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2026-05-05 17:22:26 +02:00
Simon Lucido d667b6b97f core: add ReloadCount to Manager and bump on successful reload
Introduce a counter that tracks how many configuration reloads have
been successfully completed by the manager. The increment lives in
manager_reload() right after the "point of no return", so failed
reload attempts that bail out earlier (e.g. during serialization)
do not bump the counter.

It is accessible as a new ReloadCount property to
org.freedesktop.systemd1.Manager (D-Bus) and ReloadCount to
io.systemd.Manager.Describe (Varlink).

Also add an integration test for ReloadCount
that verifies that the new ReloadCount property increments by one per
daemon-reload, accumulates correctly across multiple reloads, and that
D-Bus and Varlink return identical values. Also tests that the counter
reset after a reexec.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Simon Lucido <simonlucido@meta.com>
2026-05-03 10:23:55 +01:00
Lennart Poettering 1716467bfa NEWS: pre-announce removal of /run/boot-loader-entries/ support in logind
logind could read UAPI.1 Boot Loader Spec entries from
/run/boot-loader-entries/ in addition to ESP/XBOOTLDR. This was pretty
half-assed, and to my knowledge was never actually used much.

Let's remove support for it and simplify our codebase.

Let's schedule it for removal via NEWS in a future version, to give
people a chance to speak up.
2026-04-13 17:53:12 +02:00
Daan De Meyer 4bbdc8a6a2 nspawn: Add --restrict-address-families= option
Add a new --restrict-address-families= command line option and
corresponding RestrictAddressFamilies= setting for .nspawn files to
restrict which socket address families may be used inside a container.

Many address families such as AF_VSOCK and AF_NETLINK are not
network-namespaced, so restricting access to them in containers
improves isolation. The option supports allowlist and denylist modes
(via ~ prefix), as well as "none" to block all families, matching the
semantics of RestrictAddressFamilies= in unit files.

The address family parsing logic is extracted into a shared
parse_address_families() helper in parse-helpers.c, which is now also
used by config_parse_address_families() in load-fragment.c.

This is currently opt-in. In a future version, the default will be
changed to restrict address families to AF_INET, AF_INET6 and AF_UNIX.
2026-04-13 11:14:11 +02:00
Ivan Kruglov 23f0c9070b news: new record about strings vs enums in varlink 2026-04-10 08:37:04 -07:00
Lennart Poettering 58b9e400a6 Help users with incorrect / permission bits (#41431)
This error causes the computer to pass the emergency.target and go to
graphical.target.
Then, your window manager will have problems because it cant access any
directories, your network manager wont startup the network. In my case,
the screen just goes black. Ideally, you'd get an error message
explaining this edge scenario that's occuring to you, and an emergency
shell that makes it easy to run the necessary chmod 0755 / to proceed
with booting. IDK not sure if this is the correct way to implement this,
sorry it's my first contribution.

I ran 
`meson test -C build`
and got 

Ok:                1806
Fail:              26  
Skipped:           25  
on my cloned systemd repo before any changes, and got the same result
after my commit ¯\_(ツ)_/¯
So I hope I did that right. 
Thanks
2026-04-10 12:25:07 +02:00