From: sashiko-bot@kernel.org
To: "Sophon Z" <aiqubits@hotmail.com>
Cc: ojeda@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v3] rust: pci: reject out-of-bounds IRQ vector indices
Date: Mon, 31 Aug 2026 07:25:20 +0000 [thread overview]
Message-ID: <20260831072520.CE1321F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831-fix-pci-irq-vector-index-truncation-v3-1-a2103084d20e@hotmail.com>
> From: Sophon Z <aiqubits@hotmail.com>
>
> IrqVectorRegistration::index() accepts a usize and documents that
> out-of-bounds indices return EINVAL, while pci_irq_vector() takes an
> unsigned int.
>
> Casting an index larger than u32::MAX wraps it before the PCI core can
> validate it. In particular, u32::MAX + 1 becomes zero and can resolve to
> the first allocated vector. Values that fit in u32 but exceed
> MSI_MAX_INDEX can also reach msi_domain_get_virq() and trigger
> WARN_ON_ONCE.
>
> Check the index against the registration length before entering the C
> API, and keep the usize-to-u32 conversion checked so the ABI boundary
> does not rely on an unchecked cast.
>
> Fixes: 2fb7755b0a7e ("rust: pci: resolve IRQ in index() and embed IrqRequest in IrqVector")
>
> Signed-off-by: Sophon Z <aiqubits@hotmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831-fix-pci-irq-vector-index-truncation-v3-1-a2103084d20e@hotmail.com?part=1
next prev parent reply other threads:[~2026-08-31 7:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 7:17 [PATCH v3] rust: pci: reject out-of-bounds IRQ vector indices Sophon Z via B4 Relay
2026-08-31 7:25 ` sashiko-bot [this message]
2026-08-31 9:50 ` Miguel Ojeda
[not found] ` <SN7PR07MB9708E606E5C607ABE28C1F44CFA92@SN7PR07MB9708.namprd07.prod.outlook.com>
2026-09-01 9:47 ` 回复: " ai qubits
2026-08-31 12:45 ` Gary Guo
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=20260831072520.CE1321F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aiqubits@hotmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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