🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11626

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

#11626
From: Leon Romanovsky
Date: Thu, 05 Nov 2026 11:42
128 lines
14161 bytes
Device trust was a concept introduced by Dan in his series here:

  https://lore.kernel.org/all/20260705220819.2472765-1-djbw@kernel.org

This series takes just the Device Trust idea and works to introduce
it aside from the other components.

Device Trust is a general concept that already exists in PCI via the
'untrusted' flag. This series generalizes that into a consistent
cross-bus concept that allow the user to inject their own opinion into
how the kernel should operate the device. Three levels are defined:

 - DISABLED: Device is not operated by the kernel and is kept
   quarantined. Confidential computing kernels will start all
   devices in that mode.

 - ADVERSARY: Device may be malicious and the kernel should defend
   itself, eg by forcing use of a strong iommu, not exposing random
   kernel memory to DMA and maybe even protections in the driver from
   malicious data in DMAs.

 - FULL: The normal kernel operating mode.

Aside from this basic idea of defining the three levels, this series
also introduces a mechanism for userspace to make a policy decision
which level the device should operate in.

This is important for Confidential Computing systems that need to
evaluate a device, do a cryptographic authentication, enable PCIe link
encryption, and other steps designed to protect the system. These
operations need to be done in userspace before any DMA access to the
device is allowed.

Using this series the user can boot the kernel with a default trust
policy of DISABLED, allowing only a small number of devices like
interrupt controllers, timers and iommus to start. Then the kernel can
get into the initrd where a userspace policy agent and implement
whatever decisions are required.

For Confidential Computing it is important that the policy logic be
robustly inclusive. If the kernel autoprobes any sort of real HW
device without going through the policy phase it could become an
attack vector.

Finally the policy agent can set the trust level and then cause a
driver to bind in the normal way. User control of driver binding was
already setup in 2007 via commit b8c5cec23d5c ("Driver core: udev
triggered device-<>driver binding") which relied on the
drivers_autoprobe to work.

At least for Confidential Computing a high security policy in
userspace would leave unexpected devices as DISABLED, authenticated
PCI devices as FULL and everything else ADVERSARIAL.

A draft starting point for a policy agent has been prepared:

 https://github.com/rleon/systemd/commits/accept-d-trust-level

As a proposed systemd service that manages the process.

Thanks

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
Leon Romanovsky (17):
      Input: gameport - attach manual drivers through the driver core
      Input: serio - attach manual drivers through the driver core
      net: phy: Attach generic PHY drivers through the driver core
      wifi: mac80211_hwsim: lock device for manual driver binding
      USB: Lock registered interfaces during manual driver binding
      PNP: Attach card devices through the driver core
      cdx: Propagate DMA configuration errors
      driver core: Allow userspace to detect EPROBE_DEFER when using sysfs drivers_probe
      driver core: Introduce a generic device trust level
      driver core: Expose device trust authorization through sysfs
      driver core: Accept device trust policy on the kernel command line
      driver core: Accept device trust policy by driver name
      driver core: Preserve trust commitment beyond driver binding
      driver core: Add a global initial device trust policy
      driver core: Cover trust authorization and binding with KUnit
      driver core: Document trust admission and initrd authorization
      PCI: Replace untrusted state with device trust

 Documentation/ABI/testing/sysfs-bus-drivers-probe  |   13 +
 Documentation/ABI/testing/sysfs-devices-trust      |   61 +
 Documentation/admin-guide/kernel-parameters.txt    |   64 +
 .../driver-api/driver-model/device-trust.rst       |  294 ++++
 Documentation/driver-api/driver-model/index.rst    |    1 +
 MAINTAINERS                                        |    2 +
 drivers/base/Makefile                              |    2 +-
 drivers/base/base.h                                |   37 +
 drivers/base/bus.c                                 |    9 +-
 drivers/base/core.c                                |   18 +-
 drivers/base/dd.c                                  |   88 +-
 drivers/base/test/Makefile                         |    1 +
 drivers/base/test/device-trust-test.c              | 1607 ++++++++++++++++++++
 drivers/base/trust.c                               |  455 ++++++
 drivers/bluetooth/btusb_main.c                     |   42 +-
 drivers/cdx/cdx.c                                  |    2 +-
 drivers/input/gameport/gameport.c                  |   21 +-
 drivers/input/serio/serio.c                        |   24 +-
 drivers/iommu/amd/iommu.c                          |    3 +-
 drivers/iommu/dma-iommu.c                          |   14 +-
 drivers/iommu/intel/iommu.c                        |   17 +-
 drivers/iommu/iommu.c                              |   17 +-
 drivers/net/phy/phy_device.c                       |   39 +-
 drivers/net/wireless/virtual/mac80211_hwsim_main.c |    2 +
 drivers/pci/ats.c                                  |    4 +-
 drivers/pci/pci.c                                  |    5 +-
 drivers/pci/probe.c                                |   26 +-
 drivers/pci/quirks.c                               |    7 +-
 drivers/pnp/card.c                                 |   12 +-
 drivers/usb/core/driver.c                          |   30 +-
 drivers/usb/core/message.c                         |   10 +
 drivers/usb/core/usb.h                             |    2 +
 include/linux/device.h                             |   16 +
 include/linux/device/bus.h                         |   10 +
 include/linux/device/trust.h                       |   48 +
 include/linux/pci.h                                |   30 +-
 36 files changed, 2886 insertions(+), 147 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260915-device-trust-core-12934e618489

Best regards,
--  
Leon Romanovsky <leonro@nvidia.com>
Technical Details
Message-ID: <20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357260-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357260-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 00/17] driver core: Authorize device trust before driver binding
Date: Thu,  5 Nov 2026 13:42:13 +0200
Organization: Usenet Network
Message-ID: <20261105-device-trust-core-v1-0-1e536825b4eb@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3626935"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:zNxXpsaddrj1YnbuGB1YR+eTe3g= sha256:zyzld2wrY+SyCTWPU1ESK8uEWIZWZPb6WcvmWQjFee4=
	sha1:J77lzQ8M82vPo13uc3GbHfluwvU= sha256:W6MMQW+KbHN/Xcaze6poCQkdf0n/px6ivhsRSm105jI=
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 D3387112F3E; Thu,  5 Nov 2026 14:47:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.301
X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, 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] 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 dkUqdaDzBXql;
	Thu,  5 Nov 2026 14:47:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-357260-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 7F2E5112F35; Thu,  5 Nov 2026 14:47:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 16DA4329B1; Thu,  5 Nov 2026 11:42:55 +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=1793878970;
	b=fg+5webCq0s6sjWlwv8onPHUAZneeQfM7Nq35L+238n1PAaYwb5XU9m4XS+ndQz9x+lC
	 qxWHaSFlbFClkj6ueExahbbrD5ZjPSke3Z11oE+qC8jty3PV0KNO/eiJVbKmB7XQ2tOBf
	 r66MMB6OXghKNdebpdSfBy8v7t3XacBFdULVC42XA2yDvASjzgLNIs4I7Qk6FfCA3KOcN
	 0iBPjAm2csQRGINNVrOTwTXXZVsxGAzLP86/Q17XrfM6POzo63qi+lc+y5Qjyf/1LUVmW
	 oSsFAomGAIV8LktinkD0wYVPWY6vqi4jO7+/uc05Kb60++KPfbbLJVTSoHWkMWRJmbw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793878970;
	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=nNRa2+aOfCVTNA1AfTcRiILSfCXzP/TbgaPBxe7cp+M=;
	b=TyOOFo0nMKgqDxur8GoyrmOOYAE6FgAKqDYY6zCHsXrbV/DmSSLlcovt3m2MCbqm7i+Y
	 RW9TAeIob0srddKXLPxWNADW8yCkDJ700M68KdMdI2KpEa7V6M4RWhWZg3bhtB88XmPIk
	 hZUOSkUGz+c84lyWBckvpQTaPzaQ+FOeuJ85tom5bNEtwgwge7U/GxCeholYIM0MmvBT2
	 N0HaVnbNwflwYNkqee578wFkeqLWcpPO50xREOul+c3Pcq/GnhoyaNvCyBIwZB3BKJHVD
	 1oyshwBqzHgGYeQdPPcJy0/SgfV3luiv+ogawFPKfRjdIAuD58+2Mke2BAMXAU6WFqg==
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=LHSP6gcj;
	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 E626E606D82D;
	Thu,  5 Nov 2026 11:42:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LHSP6gcj
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=1793878959;
	b=yyyZ6xFIV+CS+ZgT30i8nSwpwxwHEymrPes84DB6E1Y2qiyGacSUvgHoMV7LQit8mpEz
	 BXASKNhKSKjKqxL2zO29FH7e8fmG4ctkEiDRUw1trJoSbCZT+ciZC5LO6Vb0o3c9BS2y1
	 CDRp7yUEyT2n60/EhuDiLe8VvkuclNHuSFmMI0ScpFQsij8mAcJCCsTYj4LuQtyqYNNfs
	 y+PjHRBIF9/jIfJ/GaVvgj/GbsgqTu4jQ2+Sax6mWsJRZyEIShL69naJCNlfXm6Vx/4jP
	 /42rrN6Ju89lYK2VH5XqoAzftpAv7O0xzniIkogjKxkh9qCTq8hepxyFwEHlRcW8XOw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793878959;
	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=nNRa2+aOfCVTNA1AfTcRiILSfCXzP/TbgaPBxe7cp+M=;
	b=PGlT0+FG6PQM/eKW5KEwWbtrK3whPGYFBDtoSkwvipTeKElNJh4ExPGCizCqpBPXQXI3
	 kd3zDnA2LV9ot8c0+dpRV/NhS6AUhihvNEEWl3ZWedM79SyrNgmLR8DjHue5C/1Yg8dzr
	 2Gu2sdVfq9KUeswox9fpFb3WGWFgOQIuanXVUAJedu9SMktMy3RkWLEVgCHZ0uXQSZwi8
	 qcaqT3DmUkeQcbkhY+7DLEBxxfCSCiOrBZti7I3ZS75r83o1lVyAc29wQkQANUTk9pa0E
	 YXBUZ7LOadi010udFp/norwWG6E/jg7YEIREARDnv7HmBzG+u4/TsLoFLacTx2r6SZg==
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=LHSP6gcj;
	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 B3F8A606A31B;
	Thu,  5 Nov 2026 11:42:38 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8654B1F000C1;
	Thu,  5 Nov 2026 11:42:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793878958;
	bh=nNRa2+aOfCVTNA1AfTcRiILSfCXzP/TbgaPBxe7cp+M=;
	h=From:To:Cc:Subject:Date;
	b=LHSP6gcjp4mEydZ1ViLj+iZVCehAC2kCPmDZuRfYlJYvaiP1ul7v4Z8h3ReQmyo98
	 Pef+LF0klHcjE/gNRKFhsjH6/va4tiLGx0cX0LenQBttgBh//azxgkbkawJOOL/XmW
	 GMaDKIKxgi23E78tGkXW+Rodfmug5gKbMzabVHpatQxpqzrwVUULv2jR6F9jquxqHf
	 lUuCwhy6URmPE3GIxm/DhywMQpohFyk1oicHLoVlLeIaqy+fFAI0oG/Z7U4oWcNWnJ
	 6TsfxxirEqAnUWR1+nNIO6clHASzuOt4ufMR8wNuNhC7mZXIxm4v4P+YMaeDdN9Jlb
	 CVz9dBmNoauMQ==
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,
	Jason Gunthorpe <jgg@ziepe.ca>
X-Mailer: git-send-email 2.56.0
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