Skip to content

driver core: Authorize device trust before driver binding

Leon Romanovsky driver-core linux-acpi linux-bluetooth linux-coco linux-doc linux-input linux-iommu linux-pci linux-sound linux-usb linux-wireless lkml netdev 4 versions – In review

Get series with b4
b4 am [email protected] change-id 20260915-device-trust-core-12934e618489

Versions newest first

  1. v4 Latest33 patches 1 replyIn review
  2. v331 patches 9 repliesSuperseded
  3. v219 patches 25 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v117 patches43 repliesSuperseded

Changes in v4 from the cover letter

- Documentation, commit messages e.t.c
- Don't fail BT device initialization if WiFI USB claim fails/
- Rename "adversary" to "adversarial" as was agreed at the beginning.
- Added new patch to drain usbfs during disconnect.
- Added another new patch to reject usbfs connect requests for
unregistered interfaces.
- Link to v3: https://patch.msgid.link/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33wifi: mac80211_hwsim: lock device for manual driver bindingdrivers/net/wireless/virtual/mac80211_hwsim_main.c+2 -00 replies
2/33Bluetooth: btusb: Fix MediaTek ISO claim lockingdrivers/bluetooth/btusb_main.c+37 -161 reply
3/33USB: Lock interfaces during manual driver bindingdrivers/bluetooth/btusb_main.c drivers/usb/core/driver.c+10 -70 replies
4/33USB: serial: Register USB drivers with their owning moduledrivers/usb/serial/usb-serial.c include/linux/usb/serial.h+6 -20 replies
5/33USB: Reject claims of DT-disabled interfacesdrivers/usb/core/driver.c+3 -20 replies
6/33USB: Reject usbfs connect requests for unregistered interfacesdrivers/usb/core/devio.c+5 -30 replies
7/33USB: Release interface claims according to binding statedrivers/usb/core/driver.c+22 -150 replies
8/33USB: Reject claims after interface registration failuredrivers/usb/core/driver.c drivers/usb/core/message.c+11 -30 replies
9/33ALSA: usb-audio: Release interface claims when probe failssound/usb/card.c+7 -00 replies
10/33USB: Pin modules for unregistered interface claimsdrivers/usb/core/driver.c drivers/usb/core/message.c drivers/usb/core/usb.h +1 more+26 -00 replies
11/33USB: Add helpers to release unpublished interface claimsdrivers/usb/core/driver.c drivers/usb/core/usb.h+29 -00 replies
12/33USB: Unwind interface claims after registration or binding failuredrivers/usb/core/message.c+40 -10 replies
13/33PNP: Attach card devices through the driver coredrivers/pnp/card.c+6 -60 replies
14/33cdx: Propagate DMA configuration errorsdrivers/cdx/cdx.c+1 -10 replies
15/33driver core: Report deferred probes through sysfs drivers_probeDocumentation/ABI/testing/sysfs-bus-drivers-probe MAINTAINERS drivers/base/bus.c+22 -20 replies
16/33driver core: Add a compatibility API for manual driver attachmentdrivers/base/base.h drivers/base/core.c drivers/base/dd.c +1 more+134 -200 replies
17/33Input: gameport - use the compatibility driver attachment APIdrivers/input/gameport/gameport.c+5 -170 replies
18/33Input: serio - use the compatibility driver attachment APIdrivers/input/serio/serio.c+10 -190 replies
19/33net: phy: Use the compatibility driver attachment APIdrivers/net/phy/phy_device.c+14 -140 replies
20/33USB: Drain usbfs when a device is unregistereddrivers/usb/core/devio.c drivers/usb/core/hub.c drivers/usb/core/usb.h+6 -20 replies
21/33driver core: Introduce a generic device trust levelDocumentation/admin-guide/kernel-parameters.txt drivers/base/Makefile drivers/base/base.h +8 more+361 -50 replies
22/33driver core: Expose device trust authorization interfacesDocumentation/ABI/testing/sysfs-devices-trust MAINTAINERS drivers/base/base.h +4 more+186 -10 replies
23/33driver core: Accept device trust policy on the kernel command lineDocumentation/ABI/testing/sysfs-devices-trust Documentation/admin-guide/kernel-parameters.txt drivers/base/base.h +2 more+134 -70 replies
24/33driver core: Accept device trust policy by driver nameDocumentation/ABI/testing/sysfs-devices-trust Documentation/admin-guide/kernel-parameters.txt drivers/base/base.h +1 more+107 -110 replies
25/33driver core: Expose committed device trust leveldrivers/base/trust.c include/linux/device/trust.h+14 -00 replies
26/33driver core: Cover trust authorization and binding with KUnitdrivers/base/test/Makefile drivers/base/test/device-trust-test.c drivers/base/trust.c+2490 -00 replies
27/33driver core: Document trust admission and initrd authorizationDocumentation/driver-api/driver-model/device-trust.rst Documentation/driver-api/driver-model/index.rst+324 -00 replies
28/33PCI: Use device trust for platform restrictionsDocumentation/driver-api/driver-model/device-trust.rst drivers/pci/ats.c drivers/pci/pci.c +4 more+38 -220 replies
29/33iommu: Use device trust for DMA restrictionsDocumentation/driver-api/driver-model/device-trust.rst drivers/iommu/amd/iommu.c drivers/iommu/dma-iommu.c +4 more+36 -330 replies
30/33driver core: Allow driver attachment with the device lock helddrivers/base/dd.c include/linux/device.h+31 -40 replies
31/33USB: Retain the result of configuration requestsdrivers/usb/core/message.c include/linux/usb.h+13 -10 replies
32/33USB: Authorize interfaces through device trustDocumentation/ABI/testing/sysfs-bus-usb Documentation/usb/authorization.rst drivers/usb/core/driver.c +4 more+48 -110 replies
33/33USB: Authorize devices through device trustDocumentation/ABI/testing/sysfs-bus-usb Documentation/usb/authorization.rst drivers/usb/core/driver.c +7 more+98 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 00/33] driver core: Authorize device trust before driver binding

Device trust policies need to precede driver setup, including manual attachment, so userspace can authorize devices before they operate.

This series introduces device trust policy, authorization, and lifetime commitment. Authorization does not reconfigure ATS capabilities or replace IOMMU domains selected during discovery and further ATS and IOMMU integration will follow in a separate series.

The table below tries to summarize the possible kernel command line options and system behavior after that:

Command line                        Initial behavior
----------------------------------  ---------------------------------------
No device_trust options             General: existing driver binding.

PCI: existing ACPI/topology
restrictions.
USB: existing authorized sysfs flow.

device_trust.default=default General: use each bus's initial policy.
PCI: keep the platform classification
and its restrictions; device rules can replace it.
USB: devices and interfaces denied by
USB defaults wait for authorization before binding.

device_trust.default=blocked General: block driver binding until
authorization.
PCI: restrict every device from
discovery; authorization does not revisit domain and ATS decisions.
USB: leave devices and interfaces
unbound until authorized.

device_trust.default=adversarial General: allow adversarial binding.
PCI: restrict every device as
adversarial.
USB: allow adversarial binding,
overriding USB authorization defaults.

device_trust.default=unrestricted General: allow unrestricted binding;
freeze trust policy changes.
PCI: replace the platform
classification; removable devices lose their DMA restrictions.
USB: authorize devices and interfaces
regardless of USB defaults.

device_trust=... General: matching rules select policy;
or device_trust.driver=... unmatched devices stay blocked.
without an explicit default PCI: rules replace the platform
classification; a device rule of default resolves to unrestricted.
USB: matching rules select device or
interface policy.

---
Changes in v4:
- Documentation, commit messages e.t.c
- Don't fail BT device initialization if WiFI USB claim fails/
- Rename "adversary" to "adversarial" as was agreed at the beginning.
- Added new patch to drain usbfs during disconnect.
- Added another new patch to reject usbfs connect requests for
unregistered interfaces.
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Rewrote all commit messages
- Split USB patches to smaller chunks
- Introduced special device attach function which works only in
untrusted mode
- Remove the special PHY -EBUSY IRQ handling.
- Clarify that further ATS and IOMMU integration follows separately.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Replace the serio and PHY attachment conversions with device_driver_attach_unrestricted(), restricted to device_trust.default=unrestricted.
- Add USB authorization on top of device trust: export device_trust_set_policy() and convert the USB authorized attributes.
- Documentation and commit messages fixes
- Small USB patches rewrote and split
- Link to v1: https://patch.msgid.link/[email protected]

---
Leon Romanovsky (33):
wifi: mac80211_hwsim: lock device for manual driver binding
Bluetooth: btusb: Fix MediaTek ISO claim locking
USB: Lock interfaces during manual driver binding
USB: serial: Register USB drivers with their owning module
USB: Reject claims of DT-disabled interfaces
USB: Reject usbfs connect requests for unregistered interfaces
USB: Release interface claims according to binding state
USB: Reject claims after interface registration failure
ALSA: usb-audio: Release interface claims when probe fails
USB: Pin modules for unregistered interface claims
USB: Add helpers to release unpublished interface claims
USB: Unwind interface claims after registration or binding failure
PNP: Attach card devices through the driver core
cdx: Propagate DMA configuration errors
driver core: Report deferred probes through sysfs drivers_probe driver core: Add a compatibility API for manual driver attachment
Input: gameport - use the compatibility driver attachment API
Input: serio - use the compatibility driver attachment API
net: phy: Use the compatibility driver attachment API
USB: Drain usbfs when a device is unregistered
driver core: Introduce a generic device trust level driver core: Expose device trust authorization interfaces driver core: Accept device trust policy on the kernel command line driver core: Accept device trust policy by driver name driver core: Expose committed device trust level driver core: Cover trust authorization and binding with KUnit driver core: Document trust admission and initrd authorization
PCI: Use device trust for platform restrictions
iommu: Use device trust for DMA restrictions
driver core: Allow driver attachment with the device lock held
USB: Retain the result of configuration requests
USB: Authorize interfaces through device trust
USB: Authorize devices through device trust

 Documentation/ABI/testing/sysfs-bus-drivers-probe  |   14 +
 Documentation/ABI/testing/sysfs-bus-usb            |   18 +
 Documentation/ABI/testing/sysfs-devices-trust      |   37 +
 Documentation/admin-guide/kernel-parameters.txt    |   37 +
 .../driver-api/driver-model/device-trust.rst       |  343 +++
 Documentation/driver-api/driver-model/index.rst    |    1 +
 Documentation/usb/authorization.rst                |   37 +
 MAINTAINERS                                        |    2 +
 drivers/base/Makefile                              |    2 +-
 drivers/base/base.h                                |   52 +
 drivers/base/bus.c                                 |    9 +-
 drivers/base/core.c                                |   52 +-
 drivers/base/dd.c                                  |  192 +-
 drivers/base/test/Makefile                         |    1 +
 drivers/base/test/device-trust-test.c              | 2487 ++++++++++++++++++++
 drivers/base/trust.c                               |  509 ++++
 drivers/bluetooth/btusb_main.c                     |   55 +-
 drivers/cdx/cdx.c                                  |    2 +-
 drivers/input/gameport/gameport.c                  |   22 +-
 drivers/input/serio/serio.c                        |   29 +-
 drivers/iommu/amd/iommu.c                          |    3 +-
 drivers/iommu/dma-iommu.c                          |   14 +-
 drivers/iommu/intel/iommu.c                        |   14 +-
 drivers/iommu/iommu.c                              |    9 +-
 drivers/net/phy/phy_device.c                       |   28 +-
 drivers/net/wireless/virtual/mac80211_hwsim_main.c |    2 +
 drivers/pci/ats.c                                  |    4 +-
 drivers/pci/pci.c                                  |    5 +-
 drivers/pci/probe.c                                |   18 +-
 drivers/pci/quirks.c                               |    7 +-
 drivers/pnp/card.c                                 |   12 +-
 drivers/usb/core/devio.c                           |   12 +-
 drivers/usb/core/driver.c                          |  118 +-
 drivers/usb/core/generic.c                         |    2 +-
 drivers/usb/core/hub.c                             |   42 +-
 drivers/usb/core/message.c                         |  104 +-
 drivers/usb/core/sysfs.c                           |    9 +-
 drivers/usb/core/trace.h                           |    2 +-
 drivers/usb/core/usb.c                             |    6 +
 drivers/usb/core/usb.h                             |    7 +-
 drivers/usb/serial/usb-serial.c                    |    4 +-
 include/linux/device.h                             |   21 +
 include/linux/device/bus.h                         |   10 +
 include/linux/device/trust.h                       |   54 +
 include/linux/pci.h                                |   18 +-
 include/linux/usb.h                                |   25 +-
 include/linux/usb/serial.h                         |    4 +-
 sound/usb/card.c                                   |    7 +
 48 files changed, 4246 insertions(+), 216 deletions(-)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260915-device-trust-core-12934e618489

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>