freenode
Kernel & Low-Level

Linux may hold driver binding until devices are authorized

A proposed driver-core policy would let administrators block PCI and USB devices until userspace allows them, aimed first at confidential-computing guests without an IOMMU.

Leon Romanovsky has proposed a kernel-wide device trust policy that would stop drivers from binding until a device is authorized, so userspace can decide whether hardware is allowed to operate before it is set up.

The change is aimed first at confidential computing guests that have no IOMMU. Today, buses apply their own restrictions: PCI already treats some externally connected devices as untrusted, and USB has its own authorization flow. There is no common policy that drivers and the rest of the kernel can share, and nothing that holds a device before probing and DMA setup. The proposal adds that admission step in the driver core, covering ordinary binding and manual attachment.

Without new boot options, existing behavior is preserved. Administrators who opt in can set a default of blocked, adversarial, or unrestricted, or leave each bus on its current policy. A blocked default withholds driver binding until authorization. An adversarial classification marks a device as potentially hostile, but classification alone does not add DMA isolation; protections still depend on the bus, the IOMMU, and the driver. Authorization also does not verify a device's identity or firmware, and it does not redo IOMMU domain or Address Translation Services decisions made at discovery. Further integration with those mechanisms is left for later work.

A global block would also stop the hardware needed to reach an initrd and attest devices, so the proposal allows boot-time exceptions for named buses, drivers, and individual devices, including hardware discovered later. Once a level is accepted, it is fixed for the device's lifetime: a failed probe or an unbind does not reopen the decision, because hardware configuration may already have been applied. Writable sysfs controls require the boot opt-in, so ordinary systems keep today's attachment assumptions. PCI would inherit its existing platform classification into the new policy.

The same posting fixes a USB userspace bug. If the generic USB driver is not bound, an unplug does not wake processes sleeping in usbfs. Disconnect notification would move earlier, before the device is removed.