From: Eric Auger <eric.auger@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm@vger.kernel.org, clg@redhat.com, reinette.chatre@intel.com,
linux-kernel@vger.kernel.org, kevin.tian@intel.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2 5/7] vfio/platform: Disable virqfds on cleanup
Date: Mon, 11 Mar 2024 10:16:35 +0100 [thread overview]
Message-ID: <70d2114b-0b72-4065-b70d-c31cbc70291a@redhat.com> (raw)
In-Reply-To: <20240308230557.805580-6-alex.williamson@redhat.com>
Hi Alex,
On 3/9/24 00:05, Alex Williamson wrote:
> irqfds for mask and unmask that are not specifically disabled by the
> user are leaked. Remove any irqfds during cleanup
>
> Cc: Eric Auger <eric.auger@redhat.com>
> Cc: stable@vger.kernel.org
> Fixes: a7fa7c77cf15 ("vfio/platform: implement IRQ masking/unmasking via an eventfd")
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> drivers/vfio/platform/vfio_platform_irq.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c
> index 61a1bfb68ac7..e5dcada9e86c 100644
> --- a/drivers/vfio/platform/vfio_platform_irq.c
> +++ b/drivers/vfio/platform/vfio_platform_irq.c
> @@ -321,8 +321,11 @@ void vfio_platform_irq_cleanup(struct vfio_platform_device *vdev)
> {
> int i;
>
> - for (i = 0; i < vdev->num_irqs; i++)
> + for (i = 0; i < vdev->num_irqs; i++) {
> + vfio_virqfd_disable(&vdev->irqs[i].mask);
> + vfio_virqfd_disable(&vdev->irqs[i].unmask);
> vfio_set_trigger(vdev, i, -1, NULL);
> + }
>
> vdev->num_irqs = 0;
> kfree(vdev->irqs);
next prev parent reply other threads:[~2024-03-11 9:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 23:05 [PATCH v2 0/7] vfio: Interrupt eventfd hardening Alex Williamson
2024-03-08 23:05 ` [PATCH v2 1/7] vfio/pci: Disable auto-enable of exclusive INTx IRQ Alex Williamson
2024-03-11 7:36 ` Eric Auger
2024-03-11 14:40 ` Alex Williamson
2024-03-08 23:05 ` [PATCH v2 2/7] vfio/pci: Lock external INTx masking ops Alex Williamson
2024-03-11 9:14 ` Eric Auger
2024-03-08 23:05 ` [PATCH v2 3/7] vfio: Introduce interface to flush virqfd inject workqueue Alex Williamson
2024-03-11 9:14 ` Eric Auger
2024-03-08 23:05 ` [PATCH v2 4/7] vfio/pci: Create persistent INTx handler Alex Williamson
2024-03-11 9:15 ` Eric Auger
2024-03-08 23:05 ` [PATCH v2 5/7] vfio/platform: Disable virqfds on cleanup Alex Williamson
2024-03-11 1:55 ` Tian, Kevin
2024-03-11 9:16 ` Eric Auger [this message]
2024-03-08 23:05 ` [PATCH v2 6/7] vfio/platform: Create persistent IRQ handlers Alex Williamson
2024-03-11 1:55 ` Tian, Kevin
2024-03-11 9:27 ` Eric Auger
2024-03-15 16:36 ` Eric Auger
2024-03-08 23:05 ` [PATCH v2 7/7] vfio/fsl-mc: Block calling interrupt handler without trigger Alex Williamson
2024-03-11 1:56 ` Tian, Kevin
2024-03-11 9:29 ` Eric Auger
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=70d2114b-0b72-4065-b70d-c31cbc70291a@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=stable@vger.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®