Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v5 1/6] scsi: mvumi: bound the per-event parameter and sense dumps
Date: Wed, 14 Oct 2026 15:32:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-171472@kernel.org> (raw)
In-Reply-To: <20261014151914.3632701-2-yhlee@isslab.korea.ac.kr>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] scsi: mvumi: missing endianness conversion for firmware event fields
--

commit edf8fe53e2e86275574e11fc999d2a119ef7acd5
Author: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

scsi: mvumi: bound the per-event parameter and sense dumps

This commit adds bounds checking to the event parameter and sense data
loops in mvumi_show_event() to prevent out-of-bounds reads when printing
firmware events to the system log.

> diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
> index e70d336b4ab39..38a92f8c25f5b 100644
> --- a/drivers/scsi/mvumi.c
> +++ b/drivers/scsi/mvumi.c
> @@ -1361,7 +1361,8 @@ static void mvumi_show_event(struct mvumi_hba *mhba,
>  	if (ptr->param_count) {
>  		printk(KERN_WARNING "Event param(len 0x%x): ",
>  						ptr->param_count);
> -		for (i = 0; i < ptr->param_count; i++)
> +		for (i = 0; i < ptr->param_count &&
> +		     i < ARRAY_SIZE(ptr->params); i++)
>  			printk(KERN_WARNING "0x%x ", ptr->params[i]);

[Severity: Medium]
As this patch modifies the parameter array loop in mvumi_show_event(), does
this code miss an endianness conversion when reading from the hardware DMA
buffer?

The u32 parameter fields from the event payload (ptr->params[i]) are
printed natively. On Big-Endian architectures, this could lead to
byte-swapped values appearing in the system logs whenever the firmware
reports an event.

Additionally, just prior to this loop in mvumi_show_event(), other
multi-byte fields from the hardware event structure (sequence_no, event_id,
and device_id) are also printed natively. Can these fields cause garbage
values to be logged on Big-Endian systems if they are not converted using
functions like le32_to_cpu() or le16_to_cpu()?

>  
>  		printk(KERN_WARNING "\n");

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014151914.3632701-1-yhlee@isslab.korea.ac.kr?part=1

  reply	other threads:[~2026-10-14 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 15:19 [PATCH v5 0/6] scsi: mvumi: bound the values the firmware supplies Yehyeong Lee
2026-10-14 15:19 ` [PATCH v5 1/6] scsi: mvumi: bound the per-event parameter and sense dumps Yehyeong Lee
2026-10-14 15:32   ` sashiko-bot [this message]
2026-10-14 15:19 ` [PATCH v5 2/6] scsi: mvumi: reject an out-of-range handshake frame length Yehyeong Lee
2026-10-14 15:33   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 3/6] scsi: mvumi: bound the hotplug event bitmap Yehyeong Lee
2026-10-14 15:35   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 4/6] scsi: mvumi: reject handshake sizes that overflow the list allocations Yehyeong Lee
2026-10-14 15:31   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 5/6] scsi: mvumi: validate the response frame tag before using it Yehyeong Lee
2026-10-14 15:33   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 6/6] scsi: mvumi: widen the flush cache loop counter Yehyeong Lee
2026-10-14 15:38   ` sashiko-bot
2026-10-14 16:28 ` [PATCH v5 0/6] scsi: mvumi: bound the values the firmware supplies Yehyeong Lee

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-171472@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yhlee@isslab.korea.ac.kr \
    /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