Latest

Technology

systemd 263 changes Thunderbolt security on Linux

systemd 263-rc2 authorizes Thunderbolt and USB4 by default when the IOMMU protects memory, and reserves more space for Device Trees in the UKI.

Translated from Spanish by an automated system. The Spanish original prevails. Read the Spanish original

Laptop with an open Linux desktop on a wooden table
Image: Unsplash

Connecting a Thunderbolt dock on Linux has been a small ceremony for years: the system detects the device, asks whether it is authorized and, until someone accepts, the peripherals do not work. The second release candidate of systemd 263 changes that logic for machines that protect memory with an IOMMU. When the memory management unit is active, the system authorizes Thunderbolt and USB4 devices by default, with no dialog and no user intervention.

The change arrives with systemd version 263-rc2, published on December 4, and replicates what the Boltd daemon already did for peripherals connected after boot. The difference lies in the timing: the default authorization also covers the initrd, the earlier phase in which user services do not yet exist. On a laptop with a dock, that means a keyboard or a disk connected via Thunderbolt can work before the system asks for the encryption password.

The IOMMU is the piece that makes the measure acceptable. It is the component that translates device memory addresses and prevents a peripheral from reading or writing areas it should not access. If a malicious Thunderbolt device tries to use DMA to attack the kernel, the IOMMU blocks access. Without that protection active, automatic authorization does not apply and the behavior remains the conservative one.

What changes at boot?

The new rule rests on the state of the IOMMU, not on the type of connector. When the system boots with DMA protection active, the device is authorized and its functions appear before user space is loaded. If the protection is not available, the system keeps manual authorization, which is what has prevented a device connected to a public port from taking control of the machine for years.

The clearest practical case is that of an encrypted laptop with a Thunderbolt dock. Until now, if the keyboard was behind the dock, the user could be left with no way to type the unlock password at boot, and had to open the laptop or connect a keyboard via USB. With early authorization, the keyboard works in the initrd and the boot sequence no longer depends on the internal hardware.

The trade-off is that the system relies on a hardware condition that may be misconfigured. An IOMMU disabled in the BIOS, or firmware that does not expose it, returns the user to the previous behavior, which in practice means the change adds nothing and breaks nothing either. Detection is what decides, and that reduces the risk of the measure being applied where it should not be.

The condition that cannot be skipped

Automatic authorization depends on the IOMMU domain having DMA protection enabled at boot time. That condition is no minor detail: DMA attacks are one of the classic ways to compromise a machine from an external port, and the reason Thunderbolt took so long to reach Linux with default authorization. A peripheral with tampered firmware can try to read kernel memory without going through the CPU, and the IOMMU is the barrier that prevents it.

It is worth noting that the IOMMU does not turn the port into a safe place for anything. It protects memory access, and does not prevent an authorized device from behaving strangely within its functions, nor does it cover flaws in the peripheral's own firmware. The measure reduces friction for the legitimate user and keeps the barrier that matters, although it does not turn an accessible port into a trusted environment.

On desktop machines with Thunderbolt and on high-end laptops, the combination of IOMMU and early authorization resembles what other systems offer. On virtual machines and on servers without those ports, the change goes unnoticed, which is exactly what is expected of a well-designed boot rule.

The other changes in 263

The rc2 arrives on top of an rc1 that already brought substantive new features, among them initial support for programs written in Rust, an experimental pseudo-terminal broker and the `systemd-manifest` tool. That base makes 263 one of the versions with the most internal movement of the year, and rc2 adds details that affect compatibility.

Change Effect
Thunderbolt and USB4 authorization By default when the IOMMU protects DMA
Uapi16Manifest Enters the shared MIME database
More space in the PE header of systemd-stub A UKI can carry Device Trees for more ARM64 machines
`$SYSTEMD_TPM2_DEVICE` TPM2 autodetection respects the variable
`systemd-vmspawn` Sets the product family in `/sys/class/dmi/id`

The UKI change is more relevant than it seems. A unified kernel image packages kernel, initrd and command line into a single signed file, and on ARM64 it can also include the Device Tree that describes the hardware. Reserving more space in the PE header allows a single image to serve several machines without recompiling the stub, something useful for anyone distributing images to a heterogeneous fleet.

The `$SYSTEMD_TPM2_DEVICE` variable solves a similar problem on machines with more than one TPM, and `systemd-vmspawn` gains its own identity in the DMI information the virtual machine sees. These are small adjustments that do not change the experience of a desktop user, but do change that of anyone maintaining images and automating deployments.

What does it mean for a laptop with a dock?

For anyone using Linux on a modern laptop, the change translates into fewer steps at boot. The dock stops being an obstacle to typing the disk password, and peripherals connected via Thunderbolt appear earlier. On a machine with an active IOMMU, the experience comes closer to that of other operating systems, which have been authorizing these devices without asking for years.

For anyone administering other people's machines, the reading is different. Automatic authorization depends on a firmware configuration that is not always under the operating system's control, and it is worth checking in the inventory which machines have the IOMMU active before taking the behavior for granted. A fleet with I/O virtualization disabled will still ask for confirmation.

There is also a consequence for support. A user who previously saw an authorization dialog and now does not may interpret the silence as a failure, when in reality it is the new rule working. Documenting the change avoids unnecessary tickets, and that part of the work is often forgotten when a version is announced.

Toward the final version of systemd 263

263 is not finished yet, and rc2 is the penultimate stop before the stable version. Those who maintain servers can wait for their distribution's package, because the changes in this release mainly affect desktop boot and image signing. Those who test development versions will find in rc2 a coherent set of adjustments, with no compatibility surprises.

As with every systemd release, the public discussion will focus on what changes by default and not on the code. Thunderbolt authorization is a good example: a three-line rule that alters the boot experience and that is only defensible because the IOMMU sets the limit. If that condition fails on any machine, the debate will return.

In the meantime, the stable version will arrive with the rest of 263, and the detail of direct EFI boot that Linux 7.4 already covers will follow its own path. Those who prefer to compile their own kernel will find in the guide to cooking a custom kernel the context to decide which patches to apply and which to let pass.

José Maldonado

Author

José Maldonado

Activist and blogger on technology, free software and blockchain.

The latest
The DoorDash security breach arrived with AI tools

Keep reading