Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219813/?format=api
{ "id": 2219813, "url": "http://patchwork.ozlabs.org/api/patches/2219813/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260404150155.3473682-1-dakr@kernel.org/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260404150155.3473682-1-dakr@kernel.org>", "list_archive_url": null, "date": "2026-04-04T15:01:49", "name": "[v2] Drivers: hv: vmbus: use generic driver_override infrastructure", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3894cb6bc26cfef2fdb26a3eed8cd4a597f13b6f", "submitter": { "id": 89037, "url": "http://patchwork.ozlabs.org/api/people/89037/?format=api", "name": "Danilo Krummrich", "email": "dakr@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260404150155.3473682-1-dakr@kernel.org/mbox/", "series": [ { "id": 498730, "url": "http://patchwork.ozlabs.org/api/series/498730/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=498730", "date": "2026-04-04T15:01:49", "name": "[v2] Drivers: hv: vmbus: use generic driver_override infrastructure", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498730/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219813/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219813/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-51879-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=fcd1WH1u;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-51879-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"fcd1WH1u\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnzMx045jz1yG2\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 02:02:20 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 6A81D300DE11\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 4 Apr 2026 15:02:17 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 4F4BC29E117;\n\tSat, 4 Apr 2026 15:02:16 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 238BA3B7A8;\n\tSat, 4 Apr 2026 15:02:15 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id B9BB2C19421;\n\tSat, 4 Apr 2026 15:02:06 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775314936; cv=none;\n b=hXy9wh6iRLHCgPLpwTcrMVazPACLWQ7Nh9iBsM8SymD9oawhjS87W3ieISdwGRqkxuPaO3agP6XPnj0eW8+V/n0gD+GqZAYcfzwKcbbTlbBR2BmRauKV9eOfq3mOPwl+K2JzC3zN0KUzvHiElzZrf0ypqZEr9Pfxj98ZpcnmBqk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775314936; c=relaxed/simple;\n\tbh=yS1a8GmMxhd+gaXjsrUMOyEcZUcN2vLf71oRyrhAVkk=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=U7whb4p0v2gfusZtNmzpc2g52jEEGYJwWhUfkdYnueaq0aVlNCTCg7MAvWKVqc6K91kFLa9il1ZJMXRQaqmhCo8VXCUU2Zh9MSNm5PXOjGXQ57XJ+RRvOcZVNMk8DUx3DQ7OfD6Ei/IAH07RXc/ud58vcvc9rrLW1G5sjTxG6o0=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=fcd1WH1u; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1775314935;\n\tbh=yS1a8GmMxhd+gaXjsrUMOyEcZUcN2vLf71oRyrhAVkk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=fcd1WH1uMPDFcW95A5bP6twrmSlGywxDbhV9K4GUdxmnw9OhLho72J9OlIZREDDfv\n\t Evf5eg+FhGKnEBZMEi0xrGzL0W0wBBPFC5ZbOalQpNWyhGwDm3HuLGvy/jgjYAq60X\n\t Jsa257f9xIzRC/LnmHpxdh9mv/JRHNm7utYMn96WoZP6ZRATrlwe1+3BmjlR9bxRPR\n\t tiA87cPHB5ojtZQJ2zSKPbtecnXGON24oyWbrZcP9XuN+XivvmLrVCQGu5orrMZe/a\n\t +xDtWMIwREbTcGNYdTKbgyxE7aDCuXqmHaashK055GEOETa+XQlaspyrGVn7GrwOhI\n\t UHZOaAkc+kiUA==", "From": "Danilo Krummrich <dakr@kernel.org>", "To": "Russell King <linux@armlinux.org.uk>,\n Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n \"Rafael J. Wysocki\" <rafael@kernel.org>,\n Ioana Ciornei <ioana.ciornei@nxp.com>, Nipun Gupta <nipun.gupta@amd.com>,\n Nikhil Agarwal <nikhil.agarwal@amd.com>,\n \"K. Y. Srinivasan\" <kys@microsoft.com>,\n Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,\n Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,\n Bjorn Helgaas <bhelgaas@google.com>, Armin Wolf <W_Armin@gmx.de>,\n Bjorn Andersson <andersson@kernel.org>,\n Mathieu Poirier <mathieu.poirier@linaro.org>,\n Vineeth Vijayan <vneethv@linux.ibm.com>,\n Peter Oberparleiter <oberpar@linux.ibm.com>,\n Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>,\n Alexander Gordeev <agordeev@linux.ibm.com>,\n Christian Borntraeger <borntraeger@linux.ibm.com>,\n Sven Schnelle <svens@linux.ibm.com>,\n Harald Freudenberger <freude@linux.ibm.com>,\n Holger Dengler <dengler@linux.ibm.com>, Mark Brown <broonie@kernel.org>,\n \"Michael S. Tsirkin\" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>,\n Xuan Zhuo <xuanzhuo@linux.alibaba.com>,\n =?utf-8?q?Eugenio_P=C3=A9rez?= <eperezma@redhat.com>,\n Alex Williamson <alex@shazbot.org>, Juergen Gross <jgross@suse.com>,\n Stefano Stabellini <sstabellini@kernel.org>,\n Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,\n \"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>", "Cc": "linux-kernel@vger.kernel.org,\n\tdriver-core@lists.linux.dev,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-hyperv@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\tplatform-driver-x86@vger.kernel.org,\n\tlinux-arm-msm@vger.kernel.org,\n\tlinux-remoteproc@vger.kernel.org,\n\tlinux-s390@vger.kernel.org,\n\tlinux-spi@vger.kernel.org,\n\tvirtualization@lists.linux.dev,\n\tkvm@vger.kernel.org,\n\txen-devel@lists.xenproject.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tDanilo Krummrich <dakr@kernel.org>,\n\tMichael Kelley <mhklinux@outlook.com>,\n\tGui-Dong Han <hanguidong02@gmail.com>", "Subject": "[PATCH v2] Drivers: hv: vmbus: use generic driver_override\n infrastructure", "Date": "Sat, 4 Apr 2026 17:01:49 +0200", "Message-ID": "<20260404150155.3473682-1-dakr@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "\n <BN7PR02MB414825D0532A1DFE16F3B671D449A@BN7PR02MB4148.namprd02.prod.outlook.com>", "References": "\n <BN7PR02MB414825D0532A1DFE16F3B671D449A@BN7PR02MB4148.namprd02.prod.outlook.com>", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "When a driver is probed through __driver_attach(), the bus' match()\ncallback is called without the device lock held, thus accessing the\ndriver_override field without a lock, which can cause a UAF.\n\nFix this by using the driver-core driver_override infrastructure taking\ncare of proper locking internally.\n\nNote that calling match() from __driver_attach() without the device lock\nheld is intentional. [1]\n\nTested-by: Michael Kelley <mhklinux@outlook.com>\nReviewed-by: Michael Kelley <mhklinux@outlook.com>\nLink: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [1]\nReported-by: Gui-Dong Han <hanguidong02@gmail.com>\nCloses: https://bugzilla.kernel.org/show_bug.cgi?id=220789\nFixes: d765edbb301c (\"vmbus: add driver_override support\")\nSigned-off-by: Danilo Krummrich <dakr@kernel.org>\n---\nChanges in v2:\n - Change patch subject and comments according to Michael's suggestion.\n---\n drivers/hv/vmbus_drv.c | 43 ++++++++++--------------------------------\n include/linux/hyperv.h | 5 -----\n 2 files changed, 10 insertions(+), 38 deletions(-)", "diff": "diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c\nindex bc4fc1951ae1..ba7326ec6add 100644\n--- a/drivers/hv/vmbus_drv.c\n+++ b/drivers/hv/vmbus_drv.c\n@@ -541,34 +541,6 @@ static ssize_t device_show(struct device *dev,\n }\n static DEVICE_ATTR_RO(device);\n \n-static ssize_t driver_override_store(struct device *dev,\n-\t\t\t\t struct device_attribute *attr,\n-\t\t\t\t const char *buf, size_t count)\n-{\n-\tstruct hv_device *hv_dev = device_to_hv_device(dev);\n-\tint ret;\n-\n-\tret = driver_set_override(dev, &hv_dev->driver_override, buf, count);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\treturn count;\n-}\n-\n-static ssize_t driver_override_show(struct device *dev,\n-\t\t\t\t struct device_attribute *attr, char *buf)\n-{\n-\tstruct hv_device *hv_dev = device_to_hv_device(dev);\n-\tssize_t len;\n-\n-\tdevice_lock(dev);\n-\tlen = sysfs_emit(buf, \"%s\\n\", hv_dev->driver_override);\n-\tdevice_unlock(dev);\n-\n-\treturn len;\n-}\n-static DEVICE_ATTR_RW(driver_override);\n-\n /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */\n static struct attribute *vmbus_dev_attrs[] = {\n \t&dev_attr_id.attr,\n@@ -599,7 +571,6 @@ static struct attribute *vmbus_dev_attrs[] = {\n \t&dev_attr_channel_vp_mapping.attr,\n \t&dev_attr_vendor.attr,\n \t&dev_attr_device.attr,\n-\t&dev_attr_driver_override.attr,\n \tNULL,\n };\n \n@@ -711,9 +682,11 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(const struct hv_driver *\n {\n \tconst guid_t *guid = &dev->dev_type;\n \tconst struct hv_vmbus_device_id *id;\n+\tint ret;\n \n-\t/* When driver_override is set, only bind to the matching driver */\n-\tif (dev->driver_override && strcmp(dev->driver_override, drv->name))\n+\t/* If a driver override is set, only bind to the matching driver */\n+\tret = device_match_driver_override(&dev->device, &drv->driver);\n+\tif (ret == 0)\n \t\treturn NULL;\n \n \t/* Look at the dynamic ids first, before the static ones */\n@@ -721,8 +694,11 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(const struct hv_driver *\n \tif (!id)\n \t\tid = hv_vmbus_dev_match(drv->id_table, guid);\n \n-\t/* driver_override will always match, send a dummy id */\n-\tif (!id && dev->driver_override)\n+\t/*\n+\t * If there's a matching driver override, this function should succeed,\n+\t * thus return a dummy device ID if no matching ID is found.\n+\t */\n+\tif (!id && ret > 0)\n \t\tid = &vmbus_device_null;\n \n \treturn id;\n@@ -1024,6 +1000,7 @@ static const struct dev_pm_ops vmbus_pm = {\n /* The one and only one */\n static const struct bus_type hv_bus = {\n \t.name =\t\t\"vmbus\",\n+\t.driver_override =\ttrue,\n \t.match =\t\tvmbus_match,\n \t.shutdown =\t\tvmbus_shutdown,\n \t.remove =\t\tvmbus_remove,\ndiff --git a/include/linux/hyperv.h b/include/linux/hyperv.h\nindex dfc516c1c719..bf689d07d750 100644\n--- a/include/linux/hyperv.h\n+++ b/include/linux/hyperv.h\n@@ -1272,11 +1272,6 @@ struct hv_device {\n \tu16 device_id;\n \n \tstruct device device;\n-\t/*\n-\t * Driver name to force a match. Do not set directly, because core\n-\t * frees it. Use driver_set_override() to set or clear it.\n-\t */\n-\tconst char *driver_override;\n \n \tstruct vmbus_channel *channel;\n \tstruct kset\t *channels_kset;\n", "prefixes": [ "v2" ] }