Article View: linux.kernel.netdev
Article #13042[PATCH v2 15/19] driver core: Expose committed device trust level
From: Leon Romanovsky
Date: Mon, 09 Nov 2026 07:33
Date: Mon, 09 Nov 2026 07:33
55 lines
10013 bytes
10013 bytes
From: Leon Romanovsky <leonro@nvidia.com>
IOMMU state can outlive a functional driver, including after failed setup
and unbind. The active trust level becomes disabled in those states, so
infrastructure needs access to the retained authorization.
Export device_get_committed_trust_level() to expose the existing lifetime
commitment independently of the active binding.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/base/trust.c | 13 +++++++++++++
include/linux/device/trust.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/base/trust.c b/drivers/base/trust.c
index 2bec6825ef31e..f79762e201178 100644
--- a/drivers/base/trust.c
+++ b/drivers/base/trust.c
@@ -93,6 +93,19 @@ enum device_trust_level device_get_trust_level(const struct device *dev)
}
EXPORT_SYMBOL_GPL(device_get_trust_level);
+/**
+ * device_get_committed_trust_level - Return the lifetime trust commitment
+ * @dev: device to inspect
+ *
+ * Return: %DEVICE_TRUST_DISABLED before admission, otherwise the level fixed
+ * before driver setup. The commitment survives setup failure and unbind.
+ */
+enum device_trust_level device_get_committed_trust_level(const struct device *dev)
+{
+ return READ_ONCE(dev->trust_committed_level);
+}
+EXPORT_SYMBOL_GPL(device_get_committed_trust_level);
+
/**
* device_is_adversarial - Test whether a device is operated as an adversary
* @dev: device to inspect
diff --git a/include/linux/device/trust.h b/include/linux/device/trust.h
index 9d6d387d01203..decf5aaf2d46d 100644
--- a/include/linux/device/trust.h
+++ b/include/linux/device/trust.h
@@ -41,6 +41,7 @@ enum device_trust_policy {
void device_trust_init(struct device *dev);
int device_trust_set_policy(struct device *dev, enum device_trust_policy policy);
enum device_trust_level device_get_trust_level(const struct device *dev);
+enum device_trust_level device_get_committed_trust_level(const struct device *dev);
bool device_is_adversarial(const struct device *dev);
#endif /* _DEVICE_TRUST_H_ */
--
2.56.0
Technical Details
Message-ID:
<20261109-device-trust-core-v2-15-3b12d9a9f861@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-359086-linux-kernel-netdev=dewy.ruReferences:
<20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com>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-359086-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v2 15/19] driver core: Expose committed device trust level Date: Mon, 9 Nov 2026 09:33:45 +0200 Organization: Usenet Network Message-ID: <20261109-device-trust-core-v2-15-3b12d9a9f861@nvidia.com> References: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="300167"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:gDlDYCcn4tBUi/K+Wk7Zgtl/oFo= sha256:GwzXxiLNPKHgg+hLwiomGQJADdDWf0OGF3Rz1Wdz4nc= sha1:cTQZp29CQuWFwLAiM+yayfiqHDI= sha256:5c9sP3PuD+SsiJ5ZLPBl8g9UNfAp0xtx1UQBSdkga60= 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 58B61113711; Mon, 9 Nov 2026 10:43:43 +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 YtIYFM-BOpgw; Mon, 9 Nov 2026 10:43:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359086-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 65E961136D9; Mon, 9 Nov 2026 10:43:28 +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 641DDA60BC; Mon, 9 Nov 2026 07:39:25 +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=1794209716; b=dtRSugBYxVntYriEZ/3tgRWac0rlvO0uhY30fEPcRfELOkXv5g9CPMPn+md1wdHn47Ox hGm6vi7zA5fqdiMvfL9+33nVrmr/9eObg2i5vZ/i8f4vAkGuJjdZaU/o5NfMRlO8N7SMH lTmP8dkHsYGF1hnAV+pGIg6WF0fgkYve/CriQKmDse1Co0bXPmgK/CU1w81vZ7sCOqKAz jlQn/WU+tHrKT5gxS7UN019Z1tbSghIW4ha7vVgAsp6LymXsZ9BOO80bDmIktGWSoMS96 l6qHQnj8nM7FVDLXfXhUEVf/g8RakznL+0iSfQCI033cmqGRmr5YqgwtCULYauftd1A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209716; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=Mz8AXu/UZmuCcqZREPjQc9nW4LF1v2AIqPDriU8p2gM=; b=kNmVEAOEr8gH0w/ku9aDeY6WEdL/ItnESjH/c4AKTV/T+B0vG7OhKYWSQOMcSs9JdYfc pbk8SsOSWABc9lvg8Xyat05xWPgFxZK9exSXP98Qi2YwJd7yMBlakc73LlxBcMgXuL4U7 g+LjvlqXsrAQajeM74o9JGKMlARTZV6ht/l9kiDM30KD7l7boXbnBOHAEu5NUUoKVigWS JCWgUSdkbiJ7FvwdGDllunrXDmoFlNFJ3HzR04DY81251HWCy8B8lFDXjW8BTV5/rs0FL piO213hz1LzIDjvr6q1kHw4U/ocwkW4PLOKQjJUAHIO2Wzt6WKeNwRqk8yBkCMdY1Jw== 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="Brs/1/m6"; 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 00B146073541; Mon, 9 Nov 2026 07:35:16 +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=Brs/1/m6 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=1794209690; b=Q75DFzkMkgIR4WbJCu6hd7MV0NI9F04jAmSwnOY7uM8qtypl4fbKSTG7iPQkfC3SIYmS bAj5LFX03lBEhf3YDod+6BZXoRh7fwN8x0WGwi23meE2iyEkIvSsxAn45jiMeWT9Fhipm ZlXz6erUf7QFIvzw8SX0oCZhNvAnp/OM28MxR6JnJ6R6+8Juqg39bDW61emD2tMTEbVZM 5mbRZ2Zw2DdjYE1mqmNvC3kGKNET8dCNQ2/8hVJOTM2dIbVHDFR5WHX7GQfStbckFlsGR HLIu5e8qQ48bi4R22F5cAe21NeCFlj9/xvwYRL6qalL/a+X2GZ9nZyU+Spf0Uj7C0eg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794209690; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=Mz8AXu/UZmuCcqZREPjQc9nW4LF1v2AIqPDriU8p2gM=; b=ibHncncJYfnabNw2MQ0fUF1A7Ul9z2fxsGPPBUQAqnV3sFiFVnw0G1wSgp4MR+Sjsf+O Io8JCeQDl5FBwFWhYHyy8AbHZA61sgEu7seNoEy1bEb5kh0dul0yLj0w7SAF9WV3ThbK1 U0ZrCoSjKRiZUSvnBgycO2YVWKUuarghZgqcSK5GrYsrHaJLXQ4b/S/7sMS9alLe13c95 f6xZ8NQCvOn7TcAuBqb9j0cLiDcXndnYs73VhDmnpMNt7nch5b+AD9czJvUdZVNTkp139 BmrZMtys5asIDwTTZKXbknHEG/6XOxS8IzdVk3mkVKJXvI2w3DuKWSvbfCcdHW8bQqg== 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="Brs/1/m6"; 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 CEBCA606B405; Mon, 9 Nov 2026 07:34:49 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C34BA1F008A2; Mon, 9 Nov 2026 07:34:48 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794209689; bh=Mz8AXu/UZmuCcqZREPjQc9nW4LF1v2AIqPDriU8p2gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Brs/1/m6NdBI9NBGZ6bvDBC1p/1LQ6Wr/mJVT2LlMj/tEtmEQO57PvprcowFnJT0Y Itea69hZnB5riJSfxpDQGqyZ2ny5p3ayaFW/xhtpw+mA5uHepseIGv3eJFq4BGmKju YBGtBlDevC4sYQ0+e2ru2JmyCjiPrthzo2URgipJJfXv8rFizZ3kZKc/ixqTBOWjgw jRWkiWecnUy+dSH5dfcWIgVZtafBZr86FBua7Bjm2J94wO9EQ7iqNtg0NqlGV2IDAt 0oPhdB/VHlyDYrOZ5IqUKzkxb9HJQGAGnEmnpYE3JEgu7aqRDfhay2UvymyBoxNjpZ XSHF9tgYkYvCw== 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-In-Reply-To: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com> 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-Mailer: b4 0.15-dev-18f8f