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

arcmsr uses three values from the DMA area the adapter writes - a
completion slot number, a type B ring index and a message length - as
subscripts or copy lengths unchecked.  Patches 1-3 clamp the length,
reject an unissued slot and wrap the index, each reproduced on KASAN.

Patch 4 is not about an adapter-supplied value.  Type B is the only type
whose completion ring is consumed with no lock: D, E and F take
acb->doneq_lock on the interrupt and the polling side, and patch 4 makes
B match them.  arcmsr_abort() masks the outbound interrupts but never
waits for a running handler, so a working adapter is enough.

Not addressed.  flag_ccb is unchecked but is the CDB address the driver
posted echoed back, so only a fabricating adapter leaves the pool.  The
data_len double fetch needs the firmware to change the field between the
two reads, which patch 1 bounds anyway.  Type F polling not restoring
cmdSMID is also handled by the dedicated polling function in
https://lore.kernel.org/all/91fa9048-ae23-4813-a8fe-bd64d5b374d5@areca.com.tw/
so I am not sending it; I will rebase whichever lands second.

v4:
- Add patch 4, serialising the type B completion ring with doneq_lock,
  as raised in review of v2 3/3:
  https://lore.kernel.org/all/sashiko-outbox-167892@kernel.org/
- Patches 1-3 unchanged.

Best regards,
Yehyeong Lee

Yehyeong Lee (4):
  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
  scsi: arcmsr: serialise the type B completion ring

 drivers/scsi/arcmsr/arcmsr_hba.c | 45 +++++++++++++++++++++++++++++---
 1 file changed, 41 insertions(+), 4 deletions(-)


base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
-- 
2.43.0


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

end of thread, other threads:[~2026-11-14  4:17 UTC | newest]

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

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.