From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/3] scsi: aic94xx: validate the EDB index in asd_get_response_tasklet()
Date: Thu, 15 Oct 2026 07:39:03 +0000 [thread overview]
Message-ID: <sashiko-outbox-172427@kernel.org> (raw)
In-Reply-To: <20261015072612.4144043-3-yhlee@isslab.korea.ac.kr>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] scsi: aic94xx: dropped task response leads to false-positive SUCCESS
--
commit 01f64db51b53d15913fd46e2c3fef1fd65e921d6
Author: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: aic94xx: validate the EDB index in asd_get_response_tasklet()
This commit validates the empty data buffer index in
asd_get_response_tasklet() to prevent out-of-bounds array access. If the
sequencer returns an invalid edb_id, the driver now prints a debug message
and returns early.
> diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
> index b26a468ddc981..35cf61f541d1b 100644
> --- a/drivers/scsi/aic94xx/aic94xx_task.c
> +++ b/drivers/scsi/aic94xx/aic94xx_task.c
> @@ -169,6 +169,12 @@ static void asd_get_response_tasklet(struct asd_ascb *ascb,
> return;
> }
>
> + if (edb_id < 0 || edb_id >= ASD_EDBS_PER_SCB) {
> + ASD_DPRINTK("edb_id is %d! resp_sb->flags is 0x%x\n",
> + edb_id, resp_sb->flags);
> + return;
> + }
^^^^^^^
[Severity: Medium]
Does returning early here leave the task status as SAS_PROTO_RESPONSE?
If this return is taken, ts->stat is not updated to an error status. For SSP
tasks, sas_end_task() in libsas maps SAS_PROTO_RESPONSE to DID_OK and
SAS_SAM_STAT_GOOD. For ATA tasks, libsas parses the task's uninitialized
response buffer, resulting in no error mask.
Could this lead to a false-positive task success, masking hardware errors or
causing silent data corruption if data was not actually transferred?
> +
> ts->buf_valid_size = 0;
> edb = asd_ha->seq.edb_arr[edb_id + escb->edb_index];
> r = edb->vaddr;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015072612.4144043-1-yhlee@isslab.korea.ac.kr?part=2
next prev parent reply other threads:[~2026-10-15 7:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 7:26 [PATCH 0/3] scsi: aic94xx: validate the sequencer-supplied EDB index Yehyeong Lee
2026-10-15 7:26 ` [PATCH 1/3] scsi: aic94xx: bail out of escb_tasklet_complete() on a bad " Yehyeong Lee
2026-10-15 7:26 ` [PATCH 2/3] scsi: aic94xx: validate the EDB index in asd_get_response_tasklet() Yehyeong Lee
2026-10-15 7:39 ` sashiko-bot [this message]
2026-10-15 7:26 ` [PATCH 3/3] scsi: aic94xx: validate the EDB index in asd_get_tmf_resp_tasklet() Yehyeong Lee
2026-10-15 7:49 ` 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=sashiko-outbox-172427@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