All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] scsi: arcmsr: bound adapter-supplied completion indices and message lengths
@ 2026-10-12  9:01 Yehyeong Lee
  2026-10-12  9:01 ` [PATCH v2 1/3] scsi: arcmsr: bound the firmware-supplied message length Yehyeong Lee
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yehyeong Lee @ 2026-10-12  9:01 UTC (permalink / raw)
  To: ching2048, mkp, James.Bottomley
  Cc: linux-scsi, linux-kernel, stable, thenzl, Yehyeong Lee

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/

Changes since v1 (patches 1 and 3 unchanged):
 - patch 2: check the completion index against ARCMSR_MAX_FREECCB_NUM
   (the pccb_pool size) rather than acb->maxFreeCCB, which
   arcmsr_get_firmware_spec() can raise above it; and skip a bad entry
   and continue rather than break, so the completion consumer index
   still advances (clearing the entry to 0xffff on type F), instead of
   stalling the queue.

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 | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-12  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12  9:01 [PATCH v2 0/3] scsi: arcmsr: bound adapter-supplied completion indices and message lengths Yehyeong Lee
2026-10-12  9:01 ` [PATCH v2 1/3] scsi: arcmsr: bound the firmware-supplied message length Yehyeong Lee
2026-10-12  9:14   ` sashiko-bot
2026-10-12  9:01 ` [PATCH v2 2/3] scsi: arcmsr: check the completion index the adapter reports Yehyeong Lee
2026-10-12  9:14   ` sashiko-bot
2026-10-12  9:01 ` [PATCH v2 3/3] scsi: arcmsr: wrap the type B completion index before using it Yehyeong Lee
2026-10-12  9:18   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.