From: sashiko-bot@kernel.org
To: "Dave Marquardt" <davemarq@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v6 3/8] scsi: ibmvfc: define asynchronous sub-queue
Date: Mon, 17 Aug 2026 20:39:01 +0000 [thread overview]
Message-ID: <20260817203902.5DEA01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817-ibmvfc-fpin-support-v6-3-62a2d525e70d@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Use-After-Free / NULL Pointer Dereference (Lifecycle Mismatch)
- [Medium] Incomplete Implementation / Commit Message Mismatch
--
--- Patch [3]: [PATCH v6 3/8] scsi: ibmvfc: define asynchronous sub-queue ---
commit 4682ac13b0e9a18a4a0d6bd0390528a5ffb87d23
Author: Dave Marquardt <davemarq@linux.ibm.com>
scsi: ibmvfc: define asynchronous sub-queue
Define data structures for asynchronous sub-queue support required for
full and extended FPIN functionality.
> Add ibmvfc_async_subq structure to represent async events received via
> the sub-queue, including FPIN status, link state, event type, and WWPN
> information.
>
> Update ibmvfc_channel_setup structure to include async_subq_handle field
> and reduce IBMVFC_MAX_CHANNELS from 502 to 501 to accommodate the async
> sub-queue. Add async_scrq pointer to ibmvfc_channels structure.
>
> Add capability flags IBMVFC_USE_ASYNC_SUBQ and IBMVFC_SUPPORT_ASYNC_SUBQ
> for negotiating async sub-queue support with VIOS during login.
[Severity: Medium]
Are these changes missing from the patch? The commit message explicitly claims
to define the ibmvfc_async_subq structure, update ibmvfc_channel_setup, reduce
IBMVFC_MAX_CHANNELS, add an async_scrq pointer, and introduce several
capability flags. However, almost none of these structural changes exist in the
actual patch.
> diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
> index e8ca0d30f483f..d8880d02685b3 100644
> --- a/drivers/scsi/ibmvscsi/ibmvfc.h
> +++ b/drivers/scsi/ibmvscsi/ibmvfc.h
[ ... ]
> @@ -990,6 +990,7 @@ struct ibmvfc_host {
> mempool_t *tgt_pool;
> struct ibmvfc_queue crq;
> struct ibmvfc_queue async_crq;
> + struct ibmvfc_queue async_sub_crq;
[Severity: Medium]
The commit message claims to add an async_scrq pointer to ibmvfc_channels,
but only async_sub_crq is added to ibmvfc_host here.
[Severity: High]
Does the adapter removal process introduce a NULL pointer dereference
during teardown?
If an FPIN async event interrupt arrives during the adapter removal process
after destroy_workqueue() is called but before free_irq(), the interrupt
handler will schedule the tasklet, which executes ibmvfc_handle_async().
In drivers/scsi/ibmvscsi/ibmvfc-core.c:ibmvfc_remove():
destroy_workqueue(vhost->fpin_workq);
vhost->fpin_workq = NULL;
Then later in drivers/scsi/ibmvscsi/ibmvfc-core.c:ibmvfc_release_crq_queue():
free_irq(vdev->irq, vhost);
tasklet_kill(&vhost->tasklet);
And the tasklet dereferences the NULL fpin_workq:
drivers/scsi/ibmvscsi/ibmvfc-core.c:ibmvfc_handle_async():
queue_work(vhost->fpin_workq, &aw->async_work_s);
Because vhost->fpin_workq was destroyed and set to NULL early in
ibmvfc_remove(), calling queue_work(NULL, ...) will immediately panic the
kernel.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-ibmvfc-fpin-support-v6-0-62a2d525e70d@linux.ibm.com?part=3
next prev parent reply other threads:[~2026-08-17 20:39 UTC|newest]
Thread overview: 26+ 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 ` Dave Marquardt
2026-08-17 20:27 ` [PATCH v6 1/8] scsi: ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-08-17 20:27 ` Dave Marquardt
2026-08-17 20:37 ` sashiko-bot
2026-08-17 20:27 ` [PATCH v6 2/8] scsi: ibmvfc: Add NOOP command support Dave Marquardt via B4 Relay
2026-08-17 20:27 ` Dave Marquardt
2026-08-17 20:41 ` sashiko-bot
2026-08-17 20:27 ` [PATCH v6 3/8] scsi: ibmvfc: define asynchronous sub-queue Dave Marquardt via B4 Relay
2026-08-17 20:27 ` Dave Marquardt
2026-08-17 20:39 ` sashiko-bot [this message]
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:27 ` Dave Marquardt
2026-08-17 20:42 ` sashiko-bot
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:27 ` Dave Marquardt
2026-08-17 20:51 ` sashiko-bot
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:27 ` Dave Marquardt
2026-08-17 20:50 ` sashiko-bot
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:28 ` Dave Marquardt
2026-08-17 20:42 ` sashiko-bot
2026-08-17 20:28 ` [PATCH v6 8/8] scsi: ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
2026-08-17 20:28 ` Dave Marquardt
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=20260817203902.5DEA01F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.