With the release of bolt 0.61 "Make the firmware do it!"
boltd gained support for preboot access control list (bootacl). The quick summary of that feature is best given by explaining what problem it solves: You are using a Thunderbolt 3 dock that has the main keyboard and mouse connected to it and you want to use the mouse and keyboard during pre- or early-boot, e.g. to enter a password to unlock the hard-drive. If the "pre-boot ACL" feature is enabled in the BIOS,
boltd will now do the right thing and Thunderbolt 3 peripherals will be functioning from early on. It comes with one big security caveat though: no device verification is possible, which means the effective security level is
user mode during pre-boot (see below for details). The requirements checklist is: bolt version >= 0.6, a kernel >= 4.17 as well as recent enough thunderbolt firmware. The feature usually needs to be explicitly enabled in the BIOS as well (it will be called something like "pre-boot ACL").
To explain in more detail how all of this works let me first quickly recap Thunderbolt 3 security levels: Thunderbolt tunnels PCIe to connect peripherals and thus allows for direct memory access (DMA); this makes in fast but can be used as an attack vector. In order to prevent DMA attacks Thunderbolt 3 introduced different security levels:
secure (SL2) and
dponly (SL3).3 In both
secure mode the device needs to authorized before the PCIe tunnels to the peripherals are established. This is done by
boltd, a system daemon that manages a list of trusted devices. After Thunderbolt devices are enrolled, i.e. stored in
boltd trust device database, the daemon will automatically authorize those devices as soon as they appear. Devices are identified via a unique identifier (UUID). But since the device itself is reporting the UUID to the system, a malicious devices could pretend to have the UUID of a already trusted device. To prevent this
secure (SL2) mode uses a per-device key that is generated by the host and stored in the device so it can be used to verify the device identity.
As mentioned above,
boltd is the user space component that will authorize the devices. As a consequence if
boltd is not running, nobody is authorizing the device and the device will not be able to function. Two of important instances where
boltd is NOT running but you might want use the mouse and keyboard in BIOS setup and probably way more important during early boot, to enter the LUKS password.
Recent BIOS versions enabled support for storing a limited list of UUIDs directly in the thunderbolt controller. This is called the pre-boot access control list (or preboot ACL), in bolt simply called "bootacl". The devices corresponding to the devices in the bootacl will be authorized during pre-boot (and only then) by the firmware. One big caveat about this feature should be become obvious now: No device verification can happen because only the UUIDs are stored but not the key, so if you are using
SECURE mode but enable preboot ACL in the BIOS you effectively will get
USER mode during boot.
The kernel exposes the bootacl via a per-domain sysfs attribute
boot_acl. Every time a device is enrolled,
boltd will automatically add it to the bootacl as well. Conversely if the device is forgotten and it is in the bootacl,
boltd will automatically remove it from the bootacl. There are is small complication to these seemingly straight forward operations: in BIOS assist mode, the thunderbolt controller is powered down by the firmware if no device is connected to it. Therefore when devices are forgotten
boltd might not be able to directly write to the
boot_acl sysfs attribute. In a dual boot scenario this is complicated by the fact that another operating system might also modify the bootacl and thus we might be out of sync. As the solution to this
boltd will write individual changes to a journal file if the thunderbolt controller is powered down and re-apply these changes (as good as possible) the next time the controller is powered up.
An easy way to check the current bootacl entries is via
boltctl domains. Currently this is read only but issue #139 is open for write support. This would be a perfect issue to start if anyone would like to hack a bit bolt.
- Meanwhile I have released bolt 0.7 'The Known Unknowns', which contains fixes for a few bugs that slipped into 0.6.
- This security mode is the default on most systems.
- A option called
usbonly (SL4)was added added to the new TitanRidge Thunderbolt 3 controller (and support for it was added to kernel 4.17).
Pingback: Links 12/2/2019: PyPy 7.0.0, HHVM 4.0.0 and CVE-2019-5736 | Techrights
Pingback: Thunderbolt - how to use keyboard during boot time - Fedora Magazine