public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Christos Longros <chris.longros@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	alex@shazbot.org
Subject: Re: [PATCH v2] vfio/pci: sanitize bogus INTx interrupt pin values
Date: Fri, 10 Apr 2026 10:53:48 -0600	[thread overview]
Message-ID: <20260410105348.6b5e504c@shazbot.org> (raw)
In-Reply-To: <20260404181436.754390-1-chris.longros@gmail.com>

On Sat,  4 Apr 2026 20:14:36 +0200
Christos Longros <chris.longros@gmail.com> wrote:

> Hi Alex,
> 
> The RTL8852CE reports a valid interrupt pin (INTA = 0x01) under
> normal operation. The 0xFF only appears after a VFIO bus reset
> bricks the device -- at that point the entire config space reads
> 0xFFFFFFFF, not just the pin register.
> 
> Since the root cause is the device bricking on bus reset, I think
> the right fix is a PCI quirk rather than the generic bounds check
> I proposed here. I have a quirk_no_bus_reset patch ready for
> 10ec:c852 (RTL8852CE) -- I'll send that as a v3 instead.

Seems like the better solution.

> Should I drop this VFIO patch entirely, or is there value in
> keeping a safety net for the pin register? The PCI spec limits it
> to 0x00-0x04, so anything outside that range is invalid, but I
> understand if you'd rather not add checks for scenarios that
> shouldn't happen with functioning hardware.

The pin register is a bit arbitrary.  We're talking about a scenario
where the device has gone fatal while it's in use.  Is it vfio-pci's
job to sanitize every config space access to prevent userspace from
crashing in such a condition, or does QEMU need to apply a bit of
sanity itself?  Maybe QEMU should detect the state of the device after
reset and perform a surprise removal if it's in a broken state.  Thanks,

Alex

      reply	other threads:[~2026-04-10 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-28 21:58 [PATCH] vfio/pci: sanitize bogus INTx interrupt pin values Christos Longros
2026-03-28 23:01 ` [PATCH v2] " Christos Longros
2026-04-01 22:59   ` Alex Williamson
2026-04-04 18:14     ` Christos Longros
2026-04-10 16:53       ` Alex Williamson [this message]

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=20260410105348.6b5e504c@shazbot.org \
    --to=alex@shazbot.org \
    --cc=alex.williamson@redhat.com \
    --cc=chris.longros@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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