Article View: linux.kernel.netdev
Article #18702[PATCH v3 05/31] USB: Reject claims of DT-disabled interfaces
From: Leon Romanovsky
Date: Wed, 18 Nov 2026 19:26
Date: Wed, 18 Nov 2026 19:26
40 lines
9346 bytes
9346 bytes
From: Leon Romanovsky <leonro@nvidia.com>
USB core skips registration of DT-disabled interfaces but keeps their
objects available to sibling drivers. A CDC-ACM control interface can
therefore claim a disabled data interface: manual claims check USB
authorization without checking Device Tree availability.
Fixes: 01fdf179f4b0 ("usb: core: skip interfaces disabled in devicetree")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/usb/core/driver.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index e1de348cc0cac..735ae3310b45d 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -28,6 +28,7 @@
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/export.h>
+#include <linux/of.h>
#include <linux/usb.h>
#include <linux/usb/quirks.h>
#include <linux/usb/hcd.h>
@@ -560,8 +561,8 @@ int usb_driver_claim_interface(struct usb_driver *driver,
device_lock(dev);
- /* reject claim if interface is not authorized */
- if (!iface->authorized) {
+ if (!iface->authorized ||
+ (dev->of_node && !of_device_is_available(dev->of_node))) {
retval = -ENODEV;
goto unlock;
}
--
2.56.1
Technical Details
Message-ID:
<20261118-device-trust-core-v3-5-d655875c4bfb@nvidia.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366377-linux-kernel-netdev=dewy.ruReferences:
<20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366377-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v3 05/31] USB: Reject claims of DT-disabled interfaces Date: Wed, 18 Nov 2026 21:26:35 +0200 Organization: Usenet Network Message-ID: <20261118-device-trust-core-v3-5-d655875c4bfb@nvidia.com> References: <20261118-device-trust-core-v3-0-d655875c4bfb@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2680523"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:unRK/8JIGTylurxFYoGoGWlko1A= sha256:XSjSEoShhgKHqPG4i0vjAQvgWH+Zy+A7RxVhTL41hUo= sha1:WSu/IVeuhsF06ogfs8OQdWIC1Nc= sha256:vRvSKkUh2ufh9vCK6Yys/kWrceMr3wQk7iy2N0udDXE= 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 698F8115395; Wed, 18 Nov 2026 22:29:12 +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 LFyKrQyJsQUU; Wed, 18 Nov 2026 22:29:09 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366377-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 6F483115391; Wed, 18 Nov 2026 22:29:01 +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 437BA127EBE; Wed, 18 Nov 2026 19:28:15 +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=1795030060; b=FGbpxAzS23t3O0vssX6YzYjWLdq8XtfFY7mefwMphd+N8i81zlat694MDhDN6R8BmIjm YEyjfY3c+oL/qsj08Lt8QfpGYNmQPzbSHh87BqTijOorYrraY09RcwbY/44KYO2DlIWw+ 48Zl+h8tYWFddKsLlXSOOT2J2/eTpJ6Upe0D+UO/r12xH8n3Fl9GxX+k/aWoeGohnjtyY Dnl6JNE5E4QsX/ZU4pnNRhAaGz4Qr/7kl2DQTaxfsqQLwbOvAnsMsBRnPYwhOjfURrQvQ yRnCbD/kBH7qqlFq8qo3fqyo44uk4BukOs/zk70bV4rDKH9ZDwIeznd7r9txjS7sHyg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795030060; 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=wbkmNHR1nRw2+5k8665nB5tZwQXzmDpbNKqdau8pHu8=; b=2W0Hk7LrlDPXLP9xBCIRViobBa3sAio6x+Nwz8WpVDn2jqPLd+cUuiBQOd3U7zh48Zno cXxQJhncUJHFGjaKg0TsxKtfoE+Hb967bVy2uaFPeTMX9uv3UK2brwXmnoP4WVQEacgv3 DNReV19uQv37sS1WoHzZwC4xybptB5RYmhZjL8An2ZnxbMksWwoBRxz4dKNANCkNqwMzn vFNERfXtQ++96qHBlfQzHhNEcve2lXkTEosYb5+Dao9n9e1J/Ksp5pANSh2u1SaDxp+kv ZvsFMTZjgNE7L/KkzTCmnrSZpm4pTFtzaqmkorQHhnwM+EaFwurPC5WxxGj2oVprmqg== 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=ESah7qvO; 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 22C7F606A33E; Wed, 18 Nov 2026 19:27:40 +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=ESah7qvO 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=1795030054; b=swbt8Rf8R5y7JT5XlP9blDYDg9/iiltw5w4tZXnYBf1UUQvIKCmoK9jD0sf1Y7k03KUs sAnjZMZU4f8fVK5oDw9ZHaoGqr39KT5KH0MEnnWTGR1gQeSYVuIUrcKjc748q6FYMXFTZ B1+6YhB3X+AFNpzvPxH6VZ2PHtYjJOM9Hb3oWVjCZ3n08NmLk05HZce1kvRqZK9JmvqlV vzLFq1HBFfgIzuFKW39AnR8fVAlLkr7fvW6w3VJTE6so7qg/qsgt90WHC1OChqyHAvwQi nc/pde7+wwkLkKo0Sxnel//FdcdCqaGt3cAJR6iMnKLM1Xb3wMwMqRsdRDrdpGTcZdA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795030054; 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=wbkmNHR1nRw2+5k8665nB5tZwQXzmDpbNKqdau8pHu8=; b=RIQZPKzd7vUqm+DW8i6+zWcsSjSoE/DjfwCssOK/kS3WDkKJD5h36uqYayyxYvU7/ccP qim0cCfMUFpOdPjX3qa9xvDtxFsVaigFGSHZi/oUmz6ZYu+jYOGSlZoBYdKXRSinK+0la JzJEa1DKo6Ms6sgpm4EZvARfhZiBan/hwdqZhX6/mAXvvkzxpER8oCY/tdsMCMkwobrmY r/Nj9Wrzlm8Sol/WIfNYm/vo1ZnUON8bC//JkI0dnY7OoRFY+G2O0lQQQHiHh8jNAUTEt XVtqJBJzlcBj/aikaKSb20VUAf3f6CVZUIusP+XzB7kHgpGzvXtNcDy9PZmp0SA7hxg== 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=ESah7qvO; 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 3F50B60A262F; Wed, 18 Nov 2026 19:27:34 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E321A1F000C8; Wed, 18 Nov 2026 19:27:32 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795030054; bh=wbkmNHR1nRw2+5k8665nB5tZwQXzmDpbNKqdau8pHu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ESah7qvOosG2ghqBoGmhIkOOsmLSoZIWc8X+J2VjFlIO/JhUEfs2YSLYquqnLtK4J /wWLdsUxxEIy2bkilx5EZc7sUtKoysLv1QPwiM2Mur7/bgAsvdm9YT3TwgbEVfsMa/ PTHsPUlQjRijmWAoSnfYY5YZD1gK/h7NLWV+IaTN4c80wiqIqpUeyMtHavWsP0uDXl /qsccpHGKQq5NfDtwfOcTtWX45kSjKZGyE71zpGz1o1BfVyNImykqcNpgtuGFVfjoU U2XbQced8/s022Y9gGnWenlrlbm9j9SW/Wi2s6TIT9BrSoYCkK24VN/ZPHDXbJN2ZU gjMI+mfq7R32w== 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-In-Reply-To: <20261118-device-trust-core-v3-0-d655875c4bfb@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