From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Yehyeong Lee <yhlee@isslab.korea.ac.kr>,
"Martin K . Petersen" <mkp@kernel.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3 2/5] scsi: aic94xx: validate the EDB index in asd_get_response_tasklet()
Date: Thu, 15 Oct 2026 09:05:30 -0400 [thread overview]
Message-ID: <06bbaf40d9188e478c4b58eaaffb58139839d217.camel@HansenPartnership.com> (raw)
In-Reply-To: <20261015091747.4184349-3-yhlee@isslab.korea.ac.kr>
First a meta question: the aic94xx is about 20 years old today ... have
you actually tested this on real hardware?
On Thu, 2026-10-15 at 18:17 +0900, Yehyeong Lee wrote:
> asd_get_response_tasklet() takes the empty data buffer index out of
> the done list status block the sequencer wrote, with the same
> arithmetic
> escb_tasklet_complete() uses on its own copy:
>
> int edb_id = ((resp_sb->flags & 0x70) >> 4)-1;
>
> The extracted field is three bits, so the subtraction yields -1
> through 6, and the function indexes seq->edb_arr[] with it without
> looking:
These are the sequencer response flags ... is there any evidence of the
sequencer ever setting these three bits to a zero value?
[...]
> + if (edb_id < 0 || edb_id >= ASD_EDBS_PER_SCB) {
Why the second comparison? As you say the value could only be -1..6
and ASD_EDBS_PER_SCB is defined to 7.
Regards,
James
next prev parent reply other threads:[~2026-10-15 13:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 9:17 [PATCH v3 0/5] scsi: aic94xx: validate the indices the sequencer supplies Yehyeong Lee
2026-10-15 9:17 ` [PATCH v3 1/5] scsi: aic94xx: bail out of escb_tasklet_complete() on a bad EDB index Yehyeong Lee
2026-10-15 9:17 ` [PATCH v3 2/5] scsi: aic94xx: validate the EDB index in asd_get_response_tasklet() Yehyeong Lee
2026-10-15 13:05 ` James Bottomley [this message]
2026-10-16 0:14 ` Yehyeong Lee
2026-10-15 9:17 ` [PATCH v3 3/5] scsi: aic94xx: validate the EDB index in asd_get_tmf_resp_tasklet() Yehyeong Lee
2026-10-15 9:17 ` [PATCH v3 4/5] scsi: aic94xx: bound the transaction context index from the sequencer Yehyeong Lee
2026-10-15 9:17 ` [PATCH v3 5/5] scsi: aic94xx: check that an ESCB lookup returned an ESCB 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=06bbaf40d9188e478c4b58eaaffb58139839d217.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=stable@vger.kernel.org \
--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
all inboxes | Powered by JetHome®