freenode
Kernel & Low-Level

Linux patch series would gate driver binding on device trust

Leon Romanovsky's proposal lets boot policy and userspace authorize hardware before drivers attach, without yet tying that decision to IOMMU domains.

A proposed change to the Linux driver core would stop devices from binding a driver until a trust policy says they may, so userspace can attest or contain hardware before it starts operating. Leon Romanovsky of NVIDIA posted the work as a large update covering the driver core plus PCI, USB, and IOMMU consumers. It is not yet merged.

Today, many devices bind as soon as they appear. USB already has an authorization attribute, and PCI can mark some devices untrusted from platform topology, but those checks are not a single policy that drivers and infrastructure share. The series adds that policy and resolves it before probe, including for manual attachment. Once a device is admitted, the chosen level stays fixed for its lifetime: a failed probe or an unbind does not reopen the decision, because hardware configuration may already have been applied and cleanup is supposed to use the same assumptions as setup.

With no new boot options, existing binding and bus rules stay in place. Administrators can set a default of blocked, adversary, or unrestricted. Blocked holds drivers off until something authorizes the device. Adversary allows binding while classifying the device as potentially hostile. Unrestricted allows normal privileges. A global block would also freeze the disks, controllers, and other hardware an initrd needs in order to attest anything else, so the proposal allows command-line exceptions by device or by bus and driver name, including for hardware discovered after boot. Those names match what sysfs publishes, so the rules do not depend on module aliases. Writable policy in sysfs is available only when device trust was opted into at boot, so ordinary systems keep today's attachment behavior.

Authorization is not attestation. The documentation in the series says trust controls how the kernel uses a device; it does not verify identity or firmware. Marking a device an adversary does not by itself isolate its DMA. On PCI, the initial target is confidential computing guests without an IOMMU. Where an IOMMU is present, later policy changes are not yet synchronized with domain selection or ATS, and Romanovsky wrote that further ATS and IOMMU integration will follow separately. Until then, discovery-time domain and ATS decisions remain as they are, even while binding is held.

The same admission path is wired through USB so configuration and attachment stay under one device lock, and through a few special bind paths, including serial I/O ports and generic Ethernet PHY fallback, that currently attach outside the normal probe sequence. Active trust can return to blocked after unbind while the committed level remains visible, so IOMMU and DMA code can still tell which operating mode was accepted.