🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17142

Re: [PATCH v2 11/19] driver core: Introduce a generic device trust level

#17142
From: Leon Romanovsky
Date: Mon, 16 Nov 2026 12:27
76 lines
11769 bytes
On Fri, Nov 13, 2026 at 10:30:23PM +1100, Alexey Kardashevskiy wrote:
> On 9/11/26 18:33, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> > 
> > Device setup needs a common operating policy before driver probing or DMA
> > configuration. Userspace must be able to hold devices disabled until it
> > authorizes them.
> > 
> > Add generic trust admission with an immutable global boot policy. Restrict
> > the compatibility attachment API to explicit global full policy and full
> > operation, checking admission before probe. Keep the operating level
> > stable until teardown and retain normal locked admission for other callers.
> > 
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

<...>

> >   #define to_driver(obj) container_of(obj, struct driver_private, kobj)
> > +enum device_trust_state {
> > +	DEVICE_TRUST_SELECTABLE,
> > +	DEVICE_TRUST_WAITING,
> 
> What is the exact difference between these? "Waiting" is waiting for what?

This is internal device trust state which is not visible to the users.
In this state driver is not yet allowed to be bound, but once will be
approved, the driver will be able to continue.

The difference between DEVICE_TRUST_WAITING and DEVICE_TRUST_SELECTABLE
is what happens when you choose a policy: SELECTABLE allows further changes
before admission, while choosing adversary or full from WAITING immediately
locks that choice.

> 
> > +	DEVICE_TRUST_AUTHORIZED,
> > +	DEVICE_TRUST_COMMITTED,
> 
> And exact difference between these two? Some documentation would be great.
> 
> dev->trust_policy is how we want the device to operate.

Yes

> dev->p->trust_state is where the device is on its way to that final policy.

Partially, it is not only takes into account authorization (where the
device on its way), but also commitment (what is possible to do).

<...>

> > +static int __device_trust_prepare(struct device *dev,
> > +				  const struct device_driver *drv, bool full_only)
> > +{
> > +	enum device_trust_policy policy;
> > +	enum device_trust_level level;
> > +	int ret;
> > +
> > +	policy = dev->trust_policy;
> > +
> > +	if (policy == DEVICE_TRUST_POLICY_DISABLED)
> > +		return -EPERM;
> > +	if (dev->bus && dev->bus->trust_resolve) {
> > +		ret = dev->bus->trust_resolve(dev, drv, policy, &level);
> > +		if (ret)
> > +			return ret;
> > +	} else {
> > +		level = policy == DEVICE_TRUST_POLICY_ADVERSARY ?
> > +			DEVICE_TRUST_ADVERSARY : DEVICE_TRUST_FULL;
> > +	}
> > +	if (level == DEVICE_TRUST_DISABLED)
> > +		return -EPERM;
> 
> This check can go right after trust_resolve() above. Thanks,

Right, thanks
Technical Details
Message-ID: <20261116122736.GL11319@unreal>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364301-linux-kernel-netdev=dewy.ru
References: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com> <20261109-device-trust-core-v2-11-3b12d9a9f861@nvidia.com> <de5772b3-c340-4822-a49a-1434ece1b144@ozlabs.ru>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364301-linux-kernel-netdev=dewy.ru
From: leon@kernel.org (Leon Romanovsky)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 11/19] driver core: Introduce a generic device trust
 level
Date: Mon, 16 Nov 2026 14:27:36 +0200
Organization: Usenet Network
Message-ID: <20261116122736.GL11319@unreal>
References: <20261109-device-trust-core-v2-0-3b12d9a9f861@nvidia.com>
 <20261109-device-trust-core-v2-11-3b12d9a9f861@nvidia.com>
 <de5772b3-c340-4822-a49a-1434ece1b144@ozlabs.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2059829"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:OHDURbeyxD/egVeZWr0z0q9DC3g= sha256:HGbyexGJ5eNHWHqPnFDPSkCH8NnWqL7SnL33k89vSP4=
	sha1:tzxNqnFRf7otPnNgj4FLZ9KTiKo= sha256:1xUf5FwP/TvSeJDBPNAfQnIk0FAHAf4m3dPnh93Vc3A=
Content-Disposition: inline
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 42138114BEF; Mon, 16 Nov 2026 15:28:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 GELzRNq33znY;
	Mon, 16 Nov 2026 15:27:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364301-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 D3A7D114BFE; Mon, 16 Nov 2026 15:27:49 +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 7E5962D289; Mon, 16 Nov 2026 12:27:43 +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=1794832062;
	b=hPs66PR+unAw+b2IMSvQDrVpBKAQ4letrCD42+JS6SqDbHOhTlde1NG/sRuYg/24RIYR
	 /XeShyGP5M5zTqsl4BtGZYr3cufs+UFuHuepEQhEbOBeM0sNuJ5wZFwlBrufSzCY/97S8
	 xI5HMjI0lR/UQ5FBplZDGgypV2+kQWSYMJ8WMsQTvJze5ptc1tZJ8ts7Ai8j0yuPk/y76
	 zF6zHk8LgNEOqKLV8rBEX9sOUBv9sZCOMgQLVgHccgm+BNYyASeNKhekzAxVtaqYRpZRL
	 v/UkmtwU+AAsEXrIYboVfUNx0UuvNlteOUJ9JOxjbWXn636nP8Jxe6CI9pQpfKXfNcw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794832062;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=wuf/Vb21lAKIWx5bIMQ7gAQDptG7l3Y/m/xV4mQ2rWs=;
	b=AdBeWEM7fhf24HYSoTbaM1e6SCJ1wPs48WgEM0xLh95VbWdhdn37Ur6+fPfDHpW5OZpk
	 oG01FbSR2wJDFwS36Cof0b5RW9xNZxjahHHw+EKzR9Fo6coRxQd7EXJ9yFJjOS9Fn3W0o
	 LsOgV8Wl+glzPcvbf4pwV9IcQxv/sP8cz8myWLqBXrGlLo/y3jy1/PcuHr6DYsle3b+mQ
	 TWVounpRFKMgp5xMjRARNSSa12VN0v256IBc2ceEA47NADd+bPgu6YkU90YtBCJJPp4G4
	 jFU6Oh/Mz82l/kj6K3WXJHWUC61rFK7xH3AWbHvFXhpFvnIYjPud2UfxIpJdDN3Bp/w==
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=WUogbiZ9;
	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 14D3B606A882;
	Mon, 16 Nov 2026 12:27:42 +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=WUogbiZ9
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=1794832061;
	b=oBoUlboc2QAKK2OXt71E8nlMMaffvHT1bg9XA6MsfylNi7KgF3w6VeXD0+1DtcV2D37k
	 X4IBGoBpE0bU2U0CGULTOX8vUlfFXo9/QJWqNx6/GmzD83kL36IZQKok+zqrAIC69SP2d
	 16ZU9FML2fq2hP4qE6T9fhuV6pzYhzZhB6Y/ldZtLrLAbuaYQoMz1HEZq4aMz+/EKRYRG
	 OgR1S6H3iIy3aEA3F5sJPtLXI3Bl92dSmwslyjW0h2iFlBPSxg48eZkjuISlg4sxiP486
	 +mxvKawIY6saKBQ/V7NY0rGc4gfMyJ4+agoWFsusOKeH0c0JSM9sn+w8Qm69AQDobxg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794832061;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=wuf/Vb21lAKIWx5bIMQ7gAQDptG7l3Y/m/xV4mQ2rWs=;
	b=e4oaMBotb5n/8h+rcirX3H74E9CVxNx9ZBkP1O1BFS22wBKKp2hr0SU9u96k6ahayhK8
	 Esd2ETWrLOkT7fhpXwGySd8y/A8MEjm9J3UQaICnPl/4cneNqLffSAad5HW9n4SWPVugH
	 Fed1UI9mDVb933lfe/yjNXfykDKhAyeWKVhiad91876UUk/xh9T65osDU9vI3fIwBr6Vs
	 lvZIb4zGHKgXzeKfJKUi9KE9QTmfAhjsCUf1rP4oGpF3O/CGUjdzcFqyA30vSswx9WD3s
	 kQ6RtyoT6dYBsQj2wIDzL5jcSpGVJPuNN/NOjbG5hATzgAhj+oWgqkujLSDm75f1zDg==
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=WUogbiZ9;
	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 2DB9E606A31C;
	Mon, 16 Nov 2026 12:27:40 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9EA1F000C4;
	Mon, 16 Nov 2026 12:27:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794832060;
	bh=wuf/Vb21lAKIWx5bIMQ7gAQDptG7l3Y/m/xV4mQ2rWs=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=WUogbiZ9t9BJObRmhrxViyzM4DGbGCmdWU+/J509gYJyRcdNJqmvKcp/LNe2UB2Rz
	 0DQXi+ux8crszv2ki8laXp/UrNNxVXcFFr4Q3hIGMcvsEezkaLulNItc8mPYn6GXfe
	 Y9wkoN9KmMwSPc3TN3NhdHrOKfTZwDqEv6xsqeL1QTjvZpgIVECXvvOpSwzLXLu2C4
	 UOnZ1gU/GEz06RPdx3Cv+dW1/R7Te7qGMzGucBd4Yl5lDnQt1Ytn2jqIqj48xRjqGw
	 kUidydPVFHybinuOJj7J4/beXvQjyP4vFINKWCnzqOlbVXIIwXzobkoHreU29LfZ8h
	 vmWM2c8JsAHYw==
X-Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Johan Hovold <johan@kernel.org>, Eric Dumazet <edumazet@kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Nipun Gupta <nipun.gupta@amd.com>,
	Nikhil Agarwal <nikhil.agarwal@amd.com>,
	Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>,
	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>,
	Alexey Kardashevskiy <aik@amd.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-In-Reply-To: <de5772b3-c340-4822-a49a-1434ece1b144@ozlabs.ru>