From: Alex Williamson <alex.williamson@nvidia.com>
To: <alex@shazbot.org>
Cc: Alex Williamson <alex.williamson@nvidia.com>,
<ptsm@linux.microsoft.com>, <nipun.gupta@amd.com>,
<nikhil.agarwal@amd.com>, <kvm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 0/3] vfio/cdx: Fix interrupt trigger races and consolidate MSI state
Date: Fri, 17 Apr 2026 14:27:55 -0600 [thread overview]
Message-ID: <20260417202800.88287-1-alex.williamson@nvidia.com> (raw)
Prasanna Kumar's original patch [1] closes a NULL-pointer dereference
that can be triggered by userspace via VFIO_DEVICE_SET_IRQS with
VFIO_IRQ_SET_DATA_BOOL or VFIO_IRQ_SET_DATA_NONE before any
VFIO_IRQ_SET_DATA_EVENTFD. Included here unchanged as patch 1/3.
Review of that patch identified a race in the same code path, where
concurrent SET_IRQS calls can potentially result in time-of-check vs
time-of-use and use-after-free inconsistencies. Patch 2/3 adds a
per-device cdx_irqs_lock mutex and serializes all MSI state updates
through vfio_cdx_set_msi_trigger(), which is the single choke-point
covering both the ioctl path and the close-device cleanup.
Patch 3/3 is a non-stable cleanup that aligns vdev->cdx_irqs to NULL
in error paths, thereby allowing removal of the now redundant
config_msi.
[1] https://lore.kernel.org/all/20260320101933.1554416-1-ptsm@linux.microsoft.com
Alex Williamson (2):
vfio/cdx: Serialize VFIO_DEVICE_SET_IRQS with a per-device mutex
vfio/cdx: Consolidate MSI configured state onto cdx_irqs
Prasanna Kumar T S M (1):
vfio/cdx: Fix NULL pointer dereference in interrupt trigger path
drivers/vfio/cdx/intr.c | 38 ++++++++++++++++++--------------------
drivers/vfio/cdx/main.c | 19 +++++++++++++++++++
drivers/vfio/cdx/private.h | 4 +++-
3 files changed, 40 insertions(+), 21 deletions(-)
--
2.51.0
next reply other threads:[~2026-04-17 20:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 20:27 Alex Williamson [this message]
2026-04-17 20:27 ` [PATCH v2 1/3] vfio/cdx: Fix NULL pointer dereference in interrupt trigger path Alex Williamson
2026-04-17 20:27 ` [PATCH v2 2/3] vfio/cdx: Serialize VFIO_DEVICE_SET_IRQS with a per-device mutex Alex Williamson
2026-04-17 20:27 ` [PATCH v2 3/3] vfio/cdx: Consolidate MSI configured state onto cdx_irqs Alex Williamson
2026-04-21 11:27 ` [PATCH v2 0/3] vfio/cdx: Fix interrupt trigger races and consolidate MSI state Agarwal, Nikhil
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=20260417202800.88287-1-alex.williamson@nvidia.com \
--to=alex.williamson@nvidia.com \
--cc=alex@shazbot.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=ptsm@linux.microsoft.com \
/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®