From: sashiko-bot@kernel.org
To: "Dave Marquardt" <davemarq@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v3 2/8] ibmvfc: Add NOOP command support
Date: Thu, 02 Jul 2026 18:11:35 +0000 [thread overview]
Message-ID: <20260702181135.D2E1D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260702-ibmvfc-fpin-support-v3-2-d95b9547cf88@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] Incomplete and insecure VFC_NOOP handling in `ibmvfc_handle_scrq` leads to protocol bypass and potential data corruption.
Pre-existing issues:
- [High] Untrusted Pointer Dereference in `ibmvfc_handle_scrq` leading to kernel panic.
--
commit 026aa88f6415105823a4b94ede2214dbab9c0f42
Author: Dave Marquardt <davemarq@linux.ibm.com>
ibmvfc: Add NOOP command support
This patch adds support for receiving and recognizing VFC_NOOP
messages from VIOS. This is done by defining the VFC_NOOP CRQ format,
recognizing the VFC_NOOP CRQ format in the CRQ handler, and setting
the "can use VFC_NOOP" bit in the capabilities sent during NPIV login.
> diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
> index b63f41a6cfffd..110d77b9aac32 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc.c
> +++ b/drivers/scsi/ibmvscsi/ibmvfc.c
[ ... ]
> @@ -4099,6 +4109,10 @@ static void ibmvfc_handle_scrq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost
> return;
> }
>
> + /* Some CRQs, e.g. a VFC_NOOP command CRQ, do not have an ioba, so evt is NULL. */
> + if (!evt)
> + return;
> +
[Severity: High]
Does this blanket check safely handle VFC_NOOP messages?
If the VIOS sends a VFC_NOOP message with a valid, non-zero ioba that
corresponds to an active SCSI command, the sub-CRQ handler bypasses the
if (!evt) check. It will proceed to validate the event and erroneously
complete the active SCSI command using the NOOP's payload.
Additionally, this blanket check silently drops any other malformed zero-ioba
CRQs without logging them, and bypasses the IBMVFC_SUPPORT_NOOP_CMD capability
validation that is explicitly implemented in the main ibmvfc_handle_crq()
handler.
Should the Sub-CRQ handler explicitly verify crq->format == IBMVFC_VFC_NOOP
exactly like the main handler does?
[Severity: High]
This is a pre-existing issue, but can the event validation later in
ibmvfc_handle_scrq() cause a kernel panic due to a wild pointer dereference?
The ioba is cast directly to the evt pointer. If the hypervisor or VIOS sends
a Sub-CRQ message with a malicious or uninitialized non-zero ioba value, evt
is dereferenced before it is validated:
drivers/scsi/ibmvscsi/ibmvfc.c:ibmvfc_handle_scrq() {
...
if (unlikely(!ibmvfc_valid_event(&evt->queue->evt_pool, evt))) {
...
}
Could the struct ibmvfc_queue be passed directly to the handler so
scrq->evt_pool can be used for validation without dereferencing the
untrusted evt pointer?
> /* The only kind of payload CRQs we should get are responses to
> * things we send. Make sure this response is to something we
> * actually sent
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-ibmvfc-fpin-support-v3-0-d95b9547cf88@linux.ibm.com?part=2
next prev parent reply other threads:[~2026-07-02 18:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 17:59 [PATCH v3 0/8] ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-07-02 17:59 ` [PATCH v3 1/8] ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-07-02 18:16 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 2/8] ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-07-02 18:11 ` sashiko-bot [this message]
2026-07-02 17:59 ` [PATCH v3 3/8] ibmvfc: make ibmvfc login to fabric Dave Marquardt via B4 Relay
2026-07-02 18:17 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 4/8] ibmvfc: define asynchronous sub-queue Dave Marquardt via B4 Relay
2026-07-02 18:12 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 5/8] ibmvfc: allocate " Dave Marquardt via B4 Relay
2026-07-02 18:20 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 6/8] ibmvfc: extend async event handlers to handle async sub queue events Dave Marquardt via B4 Relay
2026-07-02 18:14 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 7/8] ibmvfc: register and use asynchronous sub-queue for events Dave Marquardt via B4 Relay
2026-07-02 18:30 ` sashiko-bot
2026-07-02 17:59 ` [PATCH v3 8/8] ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-07-02 18:21 ` sashiko-bot
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=20260702181135.D2E1D1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=davemarq@linux.ibm.com \
--cc=linux-scsi@vger.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