Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nilesh Javali" <njavali@marvell.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 12/13] scsi: qla2xxx: Fix purex IOCB copy size on non-29xx adapters
Date: Fri, 23 Oct 2026 10:43:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-182702@kernel.org> (raw)
In-Reply-To: <20261023101600.1431179-13-njavali@marvell.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] scsi: qla2xxx: false bug fix claim and bad Fixes tag in qla24xx_copy_std_pkt()
--

commit 80556b286ead6fe5fe43e6fbf646d23656fb7c8a
Author: Nilesh Javali <njavali@marvell.com>

scsi: qla2xxx: Fix purex IOCB copy size on non-29xx adapters

This patch replaces QLA_DEFAULT_PAYLOAD_SIZE with
sizeof(struct purex_entry_24xx) in qla24xx_copy_std_pkt() for non-29xx
adapters and removes the QLA_DEFAULT_PAYLOAD_SIZE macro definition.

>     scsi: qla2xxx: Fix purex IOCB copy size on non-29xx adapters
>     
>     qla24xx_copy_std_pkt() copies a single purex IOCB from the request/
>     response ring into a purex_item. The source entry size depends on the
>     adapter: 64 bytes (struct purex_entry_24xx) on 27xx/28xx and 128 bytes
>     (struct purex_entry_24xx_ext) on 29xx.
>     
>     For non-29xx adapters the copy size was set to QLA_DEFAULT_PAYLOAD_SIZE
>     (128), causing memcpy() to read 64 bytes past the end of the 64-byte
>     source IOCB in the ring. Copy sizeof(struct purex_entry_24xx) instead so
>     exactly one IOCB is copied on these adapters.
>     
>     Cc: stable@vger.kernel.org
>     Fixes: 150a29ebda52 ("scsi: qla2xxx: Enhance purex_entry handling for 29xx series")
>     Signed-off-by: Nilesh Javali <njavali@marvell.com>
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index 97e2a1a9ce3f3..da5ca604d99eb 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -5005,7 +5005,6 @@ struct active_regions {
>  #define QLA_SET_DATA_RATE_NOLR	1
>  #define QLA_SET_DATA_RATE_LR	2 /* Set speed and initiate LR */
>  
> -#define QLA_DEFAULT_PAYLOAD_SIZE	64
>  #define QLA_MAX_IOCB_SIZE		128
>  /*
>   * This item might be allocated with a size > sizeof(struct purex_item).
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index 7bae26d4404c2..2a4eaefdcefc2 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -1220,7 +1220,7 @@ static struct purex_item
>  	if (IS_QLA29XX(ha))
>  		copy_sz = sizeof(struct purex_entry_24xx_ext);
>  	else
> -		copy_sz = QLA_DEFAULT_PAYLOAD_SIZE;
> +		copy_sz = sizeof(struct purex_entry_24xx);

[Severity: Medium]
Is the commit description accurate about QLA_DEFAULT_PAYLOAD_SIZE being 128
and causing an out-of-bounds read in qla24xx_copy_std_pkt()?

As shown in the diff for drivers/scsi/qla2xxx/qla_def.h above,
QLA_DEFAULT_PAYLOAD_SIZE is defined as 64 (whereas QLA_MAX_IOCB_SIZE is 128),
and struct purex_entry_24xx in drivers/scsi/qla2xxx/qla_fw.h is also 64 bytes
(enforced by BUILD_BUG_ON(sizeof(struct purex_entry_24xx) != 64) in
drivers/scsi/qla2xxx/qla_os.c).

Commit 7db93e3c580d ("scsi: qla2xxx: Enhance purex_entry handling for 29xx
series") already updated qla24xx_copy_std_pkt() in
drivers/scsi/qla2xxx/qla_isr.c from copying sizeof(item->iocb) to copying
copy_sz (64 bytes via QLA_DEFAULT_PAYLOAD_SIZE on non-29xx adapters).
Replacing QLA_DEFAULT_PAYLOAD_SIZE with sizeof(struct purex_entry_24xx)
therefore does not change the copy size or runtime behavior.

Additionally, the commit hash 150a29ebda52 in the Fixes tag does not exist in
the upstream tree (the upstream commit with that subject is 7db93e3c580d).
Since this change is a cleanup with no functional impact, should the Fixes
and Cc: stable@vger.kernel.org tags be dropped and the commit message updated
to reflect that this is a cleanup?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023101600.1431179-1-njavali@marvell.com?part=12

  reply	other threads:[~2026-10-23 10:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 10:15 [PATCH v2 00/13] scsi: qla2xxx: Misc. Bug fixes Nilesh Javali
2026-10-23 10:15 ` [PATCH v2 01/13] scsi: qla2xxx: Update MAINTAINERS with new FC storage alias Nilesh Javali
2026-10-23 10:15 ` [PATCH v2 02/13] scsi: qla2xxx: Update few AENs for 29xx handling Nilesh Javali
2026-10-23 10:36   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 03/13] Revert "scsi: qla2xxx: Validate BSG request_len before reading vendor_cmd[]" Nilesh Javali
2026-10-23 10:33   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 04/13] scsi: qla2xxx: Wait for session deletion before full-login LIP Nilesh Javali
2026-10-23 10:35   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 05/13] scsi: qla2xxx: Fix double addition of fcport to gnl.fcport list Nilesh Javali
2026-10-23 10:38   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 06/13] scsi: qla2xxx: Fix scan state machine race and IRQ-unsafe sp_unmap Nilesh Javali
2026-10-23 10:34   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 07/13] scsi: qla2xxx: Skip vport DPC processing during vport deletion Nilesh Javali
2026-10-23 10:15 ` [PATCH v2 08/13] scsi: qla2xxx: Add validation check for base vport index during delete Nilesh Javali
2026-10-23 10:15 ` [PATCH v2 09/13] scsi: qla2xxx: Validate vport before deletion Nilesh Javali
2026-10-23 10:15 ` [PATCH v2 10/13] scsi: qla2xxx: Fix use-after-free races during vport deletion Nilesh Javali
2026-10-23 10:53   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 11/13] scsi: qla2xxx: Re-acquire vport_slock and refresh tvp during vport DPC Nilesh Javali
2026-10-23 10:53   ` sashiko-bot
2026-10-23 10:15 ` [PATCH v2 12/13] scsi: qla2xxx: Fix purex IOCB copy size on non-29xx adapters Nilesh Javali
2026-10-23 10:43   ` sashiko-bot [this message]
2026-10-23 10:16 ` [PATCH v2 13/13] scsi: qla2xxx: Update version to 12.00.00.2610b1 Nilesh Javali

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=sashiko-outbox-182702@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=njavali@marvell.com \
    --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