🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21642

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

#21642
From: Leon Romanovsky
Date: Tue, 24 Nov 2026 09:43
179 lines
17904 bytes
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.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
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/20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com

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/20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com

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/20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com

---
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,
--  
Leon Romanovsky <leonro@nvidia.com>
Technical Details
Message-ID: <20261124-device-trust-core-v4-0-037eb0d17b1f@nvidia.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370163-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370163-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v4 00/33] driver core: Authorize device trust before driver binding
Date: Tue, 24 Nov 2026 11:43:31 +0200
Organization: Usenet Network
Message-ID: <20261124-device-trust-core-v4-0-037eb0d17b1f@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4102892"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:g0VVjQ4sWS5tQ67J9QSfx9V9ksg= sha256:M+GpemaAS4/2zrSi7z6Bub32SXedGdynNYRVC4bEPo0=
	sha1:IGG4XUiq8VKybq+4EEKwSMPXKpg= sha256:0CpCTHVixyY5dcBGogNqtfR1NMQ+bL5Zefk6IPFIiY0=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 9E531125DE8; Tue, 24 Nov 2026 12:44:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Tsm118WR03aB;
	Tue, 24 Nov 2026 12:44:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370163-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 42F30125DEA; Tue, 24 Nov 2026 12:44:26 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id AEFCF3DA58; Tue, 24 Nov 2026 09:44:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795513458;
	b=ZVJRplpw6PIje4lY8YwJGuvX5oYz6QoHTKt1UroZ7phxhL2cR3IrfbK+VDl+4rMT4GkM
	 +/kqTiu0jn84+uZ9XW70VsgIehtg3OIETR9kf2wDy5pJAyviHVMrjFmaSu7mwB3qaTqNS
	 uCXQxuADOIqvl1vROq1qAO6Mnx/AO6saMTvlfFCNXI/tM8F59ivoWD7AjIZ5zkf4oureX
	 mLCkqBqhsWno61uLSJFi+LrWjzPRBiX7P9Vx7WYRccdPeWwcJlYmlsxDNDtq/EYUmHKsu
	 3TvcLrDFjspBs83gI2DXSEuWSWrOp5yXyzef36v26TfzWTMRpDEB1Qqylu6viJDTe6w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795513458;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:X-Change-ID:X-Mailer:Content-Transfer-Encoding;
	bh=MVyh89LSnjdyTdIzBNZRkbM9Weu4yYexQ4Ew0x0v/rQ=;
	b=FQgLBKzwHtfKfWvPJSmFBja+GAoX8Gfwbi6nQW3JARaIKUtqpiCgCKdfSidWPo+5js4g
	 +9VQ5fxzJ8l9TIUnZAy6hCvotXC8qx4NS+xyqeDHuiOI60n3mRDIOB1SoTazeLG/UWvFA
	 gUfWAhMBhl7pUmlNAgB2Lbg9O+LeTYEWccy+M++xjuu1E0+9ZC4Iwf5SpyHl4NXeeg5mY
	 DATQLOUA/xEncCQIcnyNDuyCVrrnQ7gPa2jQshfnYE4EqRrooezBx5gSvq49UwcLnNSh2
	 8t7L6GK7ySYpvpX6VFBDnMcpWWD89/2cGsl1cDjOiLt/mO9/BsihMDB8K9l7CB506zA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dPz5Kqpd;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B44B606A33A;
	Tue, 24 Nov 2026 09:44:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dPz5Kqpd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795513457;
	b=MXDvT1veisZNEbpckXlUNmubq3qvDs10bLw7xROHnCUgbhgftn8KNBPfaD6QmHu4oqF/
	 1DW38P5Ub2JVawzH02f9JpN4DgoWzkCKFEZzN5MtQm+ku78drVYvonZRJVAXq1TF86uWO
	 QERRQmzv8rzQdDhVGAxW/1tgLrTavEo9YIBKy4afElMR0IX81XScHvgmkh4TmlKxaa3AW
	 pYN+hQFWmNK5oL7ijX39gfFSbaMpcz5dKiA/u0cuDoSwMdChQFK2iaMY4fP8/Muqvfqtn
	 gEO15uKGd/Pg0eyQsVLg1PzjyhAx5jDNVsh80tYcIvQOhtoqBd/Fn6AFjqgTGESeZCw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795513457;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Type:X-Change-ID:X-Mailer:
	 Content-Transfer-Encoding;
	bh=MVyh89LSnjdyTdIzBNZRkbM9Weu4yYexQ4Ew0x0v/rQ=;
	b=VaZMYQUpuLoFjJNs4yBMst+ZztBG9QMqwE44Xz2pEb2INQNNINa6jcVA/G7MzzH2D6LO
	 /c7oqyb+HXR0t0G9OYueczLYHKu1slF9xejmWdXLXwWay55bRtE+7V68eknWbg9hK15fQ
	 2w15KRWzQJE2uS4HqYN/CMkYRF+Gzvb0cPeXJKOL1a/HyoyO7WhYCmx8iH9y/3FeyQHZs
	 1h7O5eRTeYWL0aZiH5DCHpoS2Bk3CpD/bRUXWfRuamcdf3KyTUoTlXiumPSZSScrHi7rv
	 E4phhCe35S90wSHoo9h8+dxdLT+7gHIcamuvAHBL7foxnyjO31ORISjryEKA+hWmCSg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dPz5Kqpd;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F11F606A336;
	Tue, 24 Nov 2026 09:44:17 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 270941F000C0;
	Tue, 24 Nov 2026 09:44:16 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795513457;
	bh=MVyh89LSnjdyTdIzBNZRkbM9Weu4yYexQ4Ew0x0v/rQ=;
	h=From:To:Cc:Subject:Date;
	b=dPz5KqpdK9nRPKUG6HUSe0vOj09Sy3JXT3OmWwG6jKg0jPV//81DZIrqZ9cs4jXkP
	 e5jysJUgPxSHDEdvRIBPlMnRhve/j0ygvAMePt1RCUH45XYZvtV/aeyfIK/X1Ifn2B
	 ctYWo+8swz85c0hjAjpMsVLPTHzme8kWcSexD1DD291wZLjXDenM0/ykH4wFjGdmCo
	 +NEsrDDUg5fjAhyDjb5L5BMmR/S5qSXaJotzaodPFCvmwbSA5grmcSX1/GcsctGDt/
	 UtKyMHvV7Vr4u82Zoh4tL4cn07Ykj9ze1498N1xgF/MZn7PEu+qOtnZEmsE7mJUa73
	 hyuQsDuJkX2cw==
X-Cc: linux-kernel@vger.kernel.org,
	driver-core@lists.linux.dev,
	linux-input@vger.kernel.org,
	netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org,
	linux-usb@vger.kernel.org,
	linux-bluetooth@vger.kernel.org,
	linux-acpi@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	linux-coco@lists.linux.dev,
	Alexey Kardashevskiy <aik@amd.com>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-sound@vger.kernel.org,
	Jason Gunthorpe <jgg@ziepe.ca>
X-Mailer: git-send-email 2.56.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Change-ID: 20260915-device-trust-core-12934e618489
X-Mailer: b4 0.15-dev-18f8f