mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cam Miller <cam@linux.ibm.com>
To: jpb@kernel.org, joro@8bytes.org, will@kernel.org
Cc: robin.murphy@arm.com, iommu@lists.linux.dev,
	virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
	schnelle@linux.ibm.com, mjrosato@linux.ibm.com
Subject: [RFC linux v1 2/3] iommu/virtio: Prevent driver unbind via sysfs
Date: Tue, 24 Nov 2026 10:54:09 -0500	[thread overview]
Message-ID: <20261124155410.768743-3-cam@linux.ibm.com> (raw)
In-Reply-To: <20261124155410.768743-1-cam@linux.ibm.com>

Set suppress_bind_attrs on the virtio-iommu driver to prevent userspace
from triggering driver unbind via sysfs.

Unbinding the IOMMU driver from beneath live endpoint devices would
leave those devices with dangling domain pointers. This would not be a
recoverable operation.

Note that suppress_bind_attrs covers only the driver bind/unbind path,
not PCI-level device removal triggered via the sysfs remove file.

Fixes: edcd69ab9a32 ("iommu: Add virtio-iommu driver")
Signed-off-by: Cam Miller <cam@linux.ibm.com>
---
 drivers/iommu/virtio-iommu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index a08474eeed58..dd10c3e98a3d 100644
--- a/drivers/iommu/virtio-iommu.c
+++ b/drivers/iommu/virtio-iommu.c
@@ -1285,7 +1285,10 @@ static struct virtio_device_id id_table[] = {
 MODULE_DEVICE_TABLE(virtio, id_table);
 
 static struct virtio_driver virtio_iommu_drv = {
-	.driver.name		= KBUILD_MODNAME,
+	.driver		= {
+		.name		= KBUILD_MODNAME,
+		.suppress_bind_attrs     = true,
+	},
 	.id_table		= id_table,
 	.feature_table		= features,
 	.feature_table_size	= ARRAY_SIZE(features),
-- 
2.54.0


  parent reply	other threads:[~2026-11-24 15:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 15:54 [RFC linux v1 0/3] iommu/virtio: fix remove Cam Miller
2026-11-24 15:54 ` [RFC linux v1 1/3] iommu/virtio: Fix out-of-order teardown in viommu_remove() Cam Miller
2026-11-24 15:54 ` Cam Miller [this message]
2026-11-24 15:54 ` [RFC linux v1 3/3] iommu/virtio: Add device links for endpoints Cam Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124155410.768743-3-cam@linux.ibm.com \
    --to=cam@linux.ibm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=jpb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=robin.murphy@arm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=virtualization@lists.linux.dev \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®