From: Dave Marquardt <davemarq@linux.ibm.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v6 2/8] scsi: ibmvfc: Add NOOP command support
Date: Fri, 21 Aug 2026 10:11:32 -0500 [thread overview]
Message-ID: <875x13y0d7.fsf@linux.ibm.com> (raw)
In-Reply-To: <20260817204153.DC6251F00A3A@smtp.kernel.org>
sashiko-bot@kernel.org writes:
>> diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> index 22b4d639e74be..19a3f12615648 100644
>> --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>
> [ ... ]
>
>> @@ -4220,9 +4230,15 @@ static void ibmvfc_handle_scrq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost
>> case IBMVFC_CRQ_CMD_RSP:
>> break;
>> case IBMVFC_CRQ_XPORT_EVENT:
>> + case IBMVFC_NOOP:
>
> [Severity: High]
> Does this code check IBMVFC_NOOP against the correct field?
>
> The switch statement evaluates crq->valid, but IBMVFC_NOOP is a message
> format (0x03). Will the NOOP case be functionally dead here, causing NOOP
> messages to fall through to the command response handling?
Yep, my mistake. Fixed in v7.
>> return;
>> default:
>> - dev_err(vhost->dev, "Got and invalid message type 0x%02x\n", crq->valid);
>> + dev_err(vhost->dev, "Got an invalid message type 0x%02x\n", crq->valid);
>> + return;
>> + }
>> +
>> + if (unlikely(!evt)) {
>> + dev_err(vhost->dev, "Received null event\n");
>
> [Severity: High]
> Does this error path get triggered erroneously for every NOOP sent by the
> VIOS?
>
> If a NOOP message falls through to the command response handling, ioba is
> likely zero, which would cause evt to be null. Will this spam the kernel
> log with 'Received null event' at a high rate and potentially cause disk
> exhaustion?
Fixed in v7 by checking for VFC_NOOP after the switch.
> [Severity: High]
> This is a pre-existing issue, but is it safe to dereference evt->queue
> before validation?
>
> Immediately after this null check, the code executes:
>
> if (unlikely(!ibmvfc_valid_event(&evt->queue->evt_pool, evt))) {
There's
if (unlikely(!evt)) {
.
.
.
above. So this *HAS* been validated.
> [Severity: High]
> Could the destruction of vhost->fpin_workq during module removal cause a
> use-after-free?
>
> In ibmvfc_remove():
>
> destroy_workqueue(vhost->fpin_workq);
> vhost->fpin_workq = NULL;
>
> If hardware interrupts and tasklets are not disabled until
> ibmvfc_release_crq_queue() is called later, an IBMVFC_AE_FPIN event could
> trigger the interrupt handler and schedule the tasklet.
>
> Would this result in ibmvfc_handle_async() executing:
>
> queue_work(vhost->fpin_workq, &aw->async_work_s);
>
> on the explicitly destroyed and NULL-ed workqueue?
Fixed in patch 1 in v7.
-Dave
next prev parent reply other threads:[~2026-08-21 15:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 20:27 [PATCH v6 0/8] scsi: ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-08-17 20:27 ` [PATCH v6 1/8] scsi: ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-08-17 20:37 ` sashiko-bot
2026-08-21 15:09 ` Dave Marquardt
2026-08-17 20:27 ` [PATCH v6 2/8] scsi: ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-08-17 20:41 ` sashiko-bot
2026-08-21 15:11 ` Dave Marquardt [this message]
2026-08-17 20:27 ` [PATCH v6 3/8] scsi: ibmvfc: define asynchronous sub-queue Dave Marquardt via B4 Relay
2026-08-17 20:39 ` sashiko-bot
2026-08-21 15:13 ` Dave Marquardt
2026-08-17 20:27 ` [PATCH v6 4/8] scsi: ibmvfc: extend async event handlers to handle async sub queue events Dave Marquardt via B4 Relay
2026-08-17 20:42 ` sashiko-bot
2026-08-21 15:16 ` Dave Marquardt
2026-08-17 20:27 ` [PATCH v6 5/8] scsi: ibmvfc: add interrupt routine for asynchronous sub CRQ Dave Marquardt via B4 Relay
2026-08-17 20:51 ` sashiko-bot
2026-08-21 15:29 ` Dave Marquardt
2026-08-17 20:27 ` [PATCH v6 6/8] scsi: ibmvfc: extend channel registration and deregistration for async subq Dave Marquardt via B4 Relay
2026-08-17 20:50 ` sashiko-bot
2026-08-21 15:30 ` Dave Marquardt
2026-08-17 20:28 ` [PATCH v6 7/8] scsi: ibmvfc: register and use asynchronous sub CRQ for events Dave Marquardt via B4 Relay
2026-08-17 20:42 ` sashiko-bot
2026-08-21 15:44 ` Dave Marquardt
2026-08-17 20:28 ` [PATCH v6 8/8] scsi: ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-08-17 20:41 ` 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=875x13y0d7.fsf@linux.ibm.com \
--to=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