From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
To: ching2048@areca.com.tw, mkp@kernel.org,
James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, thenzl@redhat.com,
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Subject: [PATCH v3 0/3] scsi: arcmsr: bound adapter-supplied completion indices and message lengths
Date: Mon, 12 Oct 2026 20:41:00 +0900 [thread overview]
Message-ID: <cover.1791803953.git.yhlee@isslab.korea.ac.kr> (raw)
The arcmsr completion and message paths take several values straight
from the DMA area the adapter writes -- a completion slot number, a
type B completion-ring index, and an inbound message length -- and use
them as array subscripts or copy lengths without checking them against
the array or buffer they index. A malfunctioning or malicious adapter
can therefore drive an out-of-bounds access from the completion
interrupt or an ioctl.
Patch 1 clamps the firmware-supplied message length to the staging
window (heap out-of-bounds write). Patch 2 rejects a completion slot
the driver never handed out (wild pointer load and dereference on types
E and F). Patch 3 wraps the type B completion index before it is used
(out-of-bounds read, and an out-of-bounds store when the word read is
non-zero).
Each was reproduced on a KASAN build with a crafted DMA area; the
per-patch changelogs have the reports. The three are independent and
carry separate Fixes tags.
v1: https://lore.kernel.org/linux-scsi/cover.1791789900.git.yhlee@isslab.korea.ac.kr/
v2: https://lore.kernel.org/linux-scsi/cover.1791792888.git.yhlee@isslab.korea.ac.kr/
v3: patch 2 -- bound against maxFreeCCB (not the pool size) and clamp
maxFreeCCB to the pool at init, so the index cannot hit an
unpopulated (NULL) slot; v2's ARCMSR_MAX_FREECCB_NUM bound could.
patches 1, 3 unchanged.
v2: patch 2 -- bound against ARCMSR_MAX_FREECCB_NUM rather than
acb->maxFreeCCB, and on a reject release the entry and step the
queue index instead of stopping, so the consumer index does not fall
behind the producer. patches 1, 3 unchanged.
Yehyeong Lee (3):
scsi: arcmsr: bound the firmware-supplied message length
scsi: arcmsr: check the completion index the adapter reports
scsi: arcmsr: wrap the type B completion index before using it
drivers/scsi/arcmsr/arcmsr_hba.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
--
2.43.0
next reply other threads:[~2026-10-12 11:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 11:41 Yehyeong Lee [this message]
2026-10-12 11:41 ` [PATCH v3 1/3] scsi: arcmsr: bound the firmware-supplied message length Yehyeong Lee
2026-10-12 11:41 ` [PATCH v3 2/3] scsi: arcmsr: check the completion index the adapter reports Yehyeong Lee
2026-10-12 11:41 ` [PATCH v3 3/3] scsi: arcmsr: wrap the type B completion index before using it 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=cover.1791803953.git.yhlee@isslab.korea.ac.kr \
--to=yhlee@isslab.korea.ac.kr \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ching2048@areca.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=stable@vger.kernel.org \
--cc=thenzl@redhat.com \
/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®