From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Cam Miller <cam@linux.ibm.com>,
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,
mjrosato@linux.ibm.com
Subject: Re: [RFC linux v1 2/3] iommu/virtio: Prevent driver unbind via sysfs
Date: Wed, 25 Nov 2026 21:14:39 +0100 [thread overview]
Message-ID: <a993fe95d464abe9526ba71f9775924ff70f8eb6.camel@linux.ibm.com> (raw)
In-Reply-To: <20261124155410.768743-3-cam@linux.ibm.com>
On Tue, 2026-11-24 at 10:54 -0500, Cam Miller wrote:
> 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),
Makes sense to me and this is also in line with other IOMMU drivers
like arm-smmu-v3 that use the same attribute.
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Thanks,
Niklas
next prev parent reply other threads:[~2026-11-25 20:15 UTC|newest]
Thread overview: 7+ 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-25 14:59 ` Niklas Schnelle
2026-11-24 15:54 ` [RFC linux v1 2/3] iommu/virtio: Prevent driver unbind via sysfs Cam Miller
2026-11-25 20:14 ` Niklas Schnelle [this message]
2026-11-24 15:54 ` [RFC linux v1 3/3] iommu/virtio: Add device links for endpoints Cam Miller
2026-11-25 20:31 ` Niklas Schnelle
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=a993fe95d464abe9526ba71f9775924ff70f8eb6.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=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=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®