🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26313

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

#26313
From: Leon Romanovsky
Date: Thu, 03 Dec 2026 12:03
189 lines
18527 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=bus            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
                                      bus resolves to unrestricted.
                                    USB: matching rules select device or
                                      interface policy.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
Changes in v5:
- When several drivers match a device, reject a later candidate whose
  device_trust.driver= rule conflicts with the policy fixed by the first
  candidate's rule or commitment, instead of binding it against its rule.
- Add KUnit cases and documentation for multiple candidate drivers.
- Shorten device-trust.rst.
- Rename the device trust policy default to bus everywhere.
- Link to v4: https://patch.msgid.link/20261124-device-trust-core-v4-0-037eb0d17b1f@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       |  266 ++
 Documentation/driver-api/driver-model/index.rst    |    1 +
 Documentation/usb/authorization.rst                |   37 +
 MAINTAINERS                                        |    2 +
 drivers/base/Makefile                              |    2 +-
 drivers/base/base.h                                |   58 +
 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              | 2609 ++++++++++++++++++++
 drivers/base/trust.c                               |  543 ++++
 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, 4331 insertions(+), 216 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
change-id: 20260915-device-trust-core-12934e618489

Best regards,
--  
Leon Romanovsky <leonro@nvidia.com>
Technical Details
Message-ID: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376535-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376535-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v5 00/33] driver core: Authorize device trust before driver binding
Date: Thu,  3 Dec 2026 14:03:22 +0200
Organization: Usenet Network
Message-ID: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2479561"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dUUsqA5EgAOq9IUKzJjDk70nIfA= sha256:WFTh1yHAJ/zXau7OupNXC0+OJvYbIem5Ba6fGT89Pvg=
	sha1:TmxsThV3VvisAAmtXlt5ofdZIlQ= sha256:CtHt6u97z+c1735NAgng1Ts4XzYH5Ftg6Qeo2u6Q/xU=
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 14DF0117900; Thu,  3 Dec 2026 15:04:22 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.64
X-Spam-Status: No, score=-2.64 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DKIMWL_WL_HIGH=-0.24, 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] 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 DuV6M9QodMjQ;
	Thu,  3 Dec 2026 15:04:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376535-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 16E541178D8; Thu,  3 Dec 2026 15:04:08 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 1B8226032D1; Thu,  3 Dec 2026 12:04:08 +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=1796299444;
	b=pE6LqEjshBd0pJa231MZzDGeuSRILyTebh1GaMpbcF/8RvibtOqAOKeah7lse+tZ/NMw
	 gPn/W77cK0viQGB/e7VJAIpTKrF+oFuYbqAW5VoeF8wKBn3pX35oAJr10tF38/85LY8f5
	 +HfGGNbGngZycIXj/sZ+rXD/CvB4UFBX5OdlXSrqrrs1CAAZa/Ir4X0eQt4N12jvtbkuj
	 aMhKwGdXSa2JAVwi7bEwk783FVlDqUOqCKYWQHLoEohdE/l94RH/X4HrLxJjYQQFiuBui
	 9fJIORr0NTU1kUW1ETiJZyDCdTNPKp4ouaHsVhTG+xuPTfYYbuSbaTmp+g9Ti83VUkw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796299444;
	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=a8wxBkN+GKk2oxd2MbCWgSqzbifnHKSl7XPZb4tM8g0=;
	b=ScG3l6wVuknYQ6SLHcDVqCoiHnoh3SeU4RC+J6fiEIiGDdCYHnlj63pnQPoOlWl6+bSi
	 mZSSZajx0aUD+XnJpsC+qDFkFwFQNRBrIg9tqFwgSxSIK3Ms1nyemkGbQXjM5xcDaNyc/
	 jKAE/CyIgBpMrXtohQJYv/X39LX6TJmw4l1DTAQRAeRfodDwnuzJrt5/QS3wZ/Y46sXwv
	 kpU7iW7glKqHCa7fbRBU8uirRlTE3qU3HVjtAmLkWU1L+UXe3hNfsuuM1KQwJN7zaNiEP
	 TFGNro5Mf/SlWS+TO7Lrpr13Iefb171PewToF3cL6CV8iVxk/7BJqmKCjzWqfcFozeg==
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=KZBSsx8D;
	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 97C07606A696;
	Thu,  3 Dec 2026 12:04:04 +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=KZBSsx8D
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=1796299443;
	b=azDEb6Jfh2RDGyYjWmb4kuWDmqzEVlQOiRin1ytOrgWdBXJHVpjxgU1osHdKXi+aNYwN
	 xfrMHqJbLPI+mLRfPT+d5m9bBGtpejicLRelHoWrUqy/7jkqusVpng1yWLDe9xQvr9nyr
	 M4aIEu5z3ukZpC9D+RbY+rgNS/87IvZQ7WxwnQ8fOi4/h9klMEVzDA51xTJvq1EXow+4g
	 6sbkCWT9gDN7FDiQZLmPtLK+BGx9Q4dYmfmL6FgACcfpSr7Wb9A07V0O4n6o0ubDPcr4U
	 DdsxD7C7xVBvwaqp0yH20W7SWKquoXHZef5ZjkOUwat3QtpnscNE1qm1vXMgncw9V5g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796299443;
	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=a8wxBkN+GKk2oxd2MbCWgSqzbifnHKSl7XPZb4tM8g0=;
	b=KrVtC/BnJjFPwAlfiTlqVvP2E9LOAS0PuuHIXuJ/PU6aEsgNDd4q3OEqD3XVyZy+zYV8
	 EUn+HIH19Vz5aHNw5yyXefr//oC8AWPkTrJuPfuwyebsEENiC9HS+3T7nvhaqFWfg96Ef
	 VEvzblExfZrWL3ywoohAOe19p0pgQPTiqGkqjtu+L4UWpQBtdcw2+NosugRdjUWtmzxeF
	 JIG1IA9fAhgfAX97bOmn+VuDi3fRc+YlrCj+TlPOOdgcW28WLhfEeGKJVXD2sBgzssgvN
	 Y27QjUfCKtwPjEb5Zqb1rYpdbO/Wh/Y/8vDpoGmtRTQkV+E6c7iaZUcny9RpeTSq4Yg==
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=KZBSsx8D;
	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 B521F606A337;
	Thu,  3 Dec 2026 12:04:03 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 865EB1F000C1;
	Thu,  3 Dec 2026 12:04:02 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796299443;
	bh=a8wxBkN+GKk2oxd2MbCWgSqzbifnHKSl7XPZb4tM8g0=;
	h=From:To:Cc:Subject:Date;
	b=KZBSsx8D9na6AJsD6egPJCqiQnvyBlvYAc9F3yzcsC6uqSsfk3yUB1ZzaBAGSO2E3
	 J63ZwjwKmFQRxAYT3dydguJRaBJV5V9ywSk07FIF4UbzoigRfMIetz42tkr5HzCPLI
	 /346wzHz1MaqUm4uNWpf+xP4cgRMA99KmCSYkboSG76+apk5d6GL9CmS4Hzef/BKoH
	 //kei37eVQ/wvpVtjtXmiJjncYumrlWqGRHjzkmX13gY0M56WIzrMwBsTFOSWI33iT
	 fcj12oic7JdQbedFwCnmjYnvWbuyuT5ZuQBfv/eRy2N3+tka0KlH5phkJVMDnyUjyH
	 YXPfKD3ScZ31A==
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>,
	Takashi Iwai <tiwai@suse.de>
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.17-dev-d2b70