From: Dave Marquardt <davemarq@linux.ibm.com>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v14 09/11] scsi: ibmvfc: extend channel reg/dereg helpers for async sub-CRQ
Date: Fri, 16 Oct 2026 10:53:51 -0500 [thread overview]
Message-ID: <87qzhpbq0g.fsf@linux.ibm.com> (raw)
In-Reply-To: <sashiko-outbox-173056@kernel.org> (sashiko-bot@kernel.org's message of "Thu, 15 Oct 2026 15:21:15 +0000")
sashiko-bot@kernel.org writes:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] scsi: ibmvfc: race reading uninitialized hwq_id on early interrupt
> --
>
> commit 305244f5c1aeffae812f2cadfc3586d45148fbbe
> Author: Dave Marquardt <davemarq@linux.ibm.com>
>
> scsi: ibmvfc: extend channel reg/dereg helpers for async sub-CRQ
>
> This commit extends ibmvfc_register_channel() and ibmvfc_deregister_channel()
> to handle IBMVFC_PROTO_ASYNC channels. It removes the __maybe_unused
> annotation from ibmvfc_interrupt_async_subq and updates error messages to
> include the channel protocol.
>
>> diff --git a/drivers/scsi/ibmvscsi/ibmvfc-core.c b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> index fc69012efccc0..b12655f028879 100644
>> --- a/drivers/scsi/ibmvscsi/ibmvfc-core.c
>> +++ b/drivers/scsi/ibmvscsi/ibmvfc-core.c
>
> [ ... ]
>
>> @@ -6882,7 +6901,8 @@ static int ibmvfc_register_channel(struct ibmvfc_host *vhost,
>> rc = request_irq(scrq->irq, scrq->handler, 0, scrq->name, scrq);
>
> [Severity: Low]
> Is there a potential race condition here when the interrupt is requested?
>
> If a hardware interrupt triggers immediately after request_irq() enables it,
> the newly bound handler ibmvfc_interrupt_async_subq() could run before
> scrq->hwq_id is initialized:
>
> ibmvfc_register_channel()
> ...
> rc = request_irq(scrq->irq, scrq->handler, 0, scrq->name, scrq);
> ...
> scrq->hwq_id = index;
>
> If an early interrupt happens, the handler calls ibmvfc_toggle_scrq_irq(),
> which uses scrq->hwq_id for error logging if the hypervisor call fails.
>
> Could this result in reading an uninitialized (zeroed) scrq->hwq_id in the
> dev_err() message? Would it be safer to initialize scrq->hwq_id before
> calling request_irq()?
Yes, it would be safer. Consequences, as you say, are low, as hwq_id is
used for error logging in ibmvfc_toggle_scrq_irq(). In the case
described, it would log "sub-crq[0]" rather than the correct sub-crq index.
Will fix in v15.
-Dave
next prev parent reply other threads:[~2026-10-16 15:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 15:06 [PATCH v14 00/11] scsi: ibmvfc: make ibmvfc support FPIN messages Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 01/11] scsi: ibmvfc: fix IRQ leak and guard deregister on channel reg failure Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 02/11] scsi: ibmvfc: fix potential clobbering of rc after failed irq setup Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 03/11] scsi: ibmvfc: fix potential NULL pointer dereference on failed queue allocation Dave Marquardt via B4 Relay
2026-10-15 15:20 ` sashiko-bot
2026-10-15 16:15 ` Dave Marquardt
2026-10-15 15:07 ` [PATCH v14 04/11] scsi: ibmvfc: add basic FPIN support Dave Marquardt via B4 Relay
2026-10-15 15:18 ` sashiko-bot
2026-10-15 21:47 ` Dave Marquardt
2026-10-15 15:07 ` [PATCH v14 05/11] scsi: ibmvfc: add NOOP command support Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 06/11] scsi: ibmvfc: add FPIN extended flag and async sub-CRQ queue handle Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 07/11] scsi: ibmvfc: extend async event handlers for async sub-CRQ events Dave Marquardt via B4 Relay
2026-10-15 15:20 ` sashiko-bot
2026-10-16 14:47 ` Dave Marquardt
2026-10-15 15:07 ` [PATCH v14 08/11] scsi: ibmvfc: add interrupt routine for asynchronous sub CRQ Dave Marquardt via B4 Relay
2026-10-15 15:07 ` [PATCH v14 09/11] scsi: ibmvfc: extend channel reg/dereg helpers for async sub-CRQ Dave Marquardt via B4 Relay
2026-10-15 15:21 ` sashiko-bot
2026-10-16 15:53 ` Dave Marquardt [this message]
2026-10-15 15:07 ` [PATCH v14 10/11] scsi: ibmvfc: register and use asynchronous sub CRQ for events Dave Marquardt via B4 Relay
2026-10-15 15:28 ` sashiko-bot
2026-10-16 16:23 ` Dave Marquardt
2026-10-15 15:07 ` [PATCH v14 11/11] scsi: ibmvfc: handle extended FPIN events Dave Marquardt via B4 Relay
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=87qzhpbq0g.fsf@linux.ibm.com \
--to=davemarq@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=sashiko-bot@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