All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/6] scsi: mvumi: bound the values the firmware supplies
@ 2026-10-14 15:19 Yehyeong Lee
  2026-10-14 15:19 ` [PATCH v5 1/6] scsi: mvumi: bound the per-event parameter and sense dumps Yehyeong Lee
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Yehyeong Lee @ 2026-10-14 15:19 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, linux-kernel, stable, yhlee

This folds the two mvumi series I have on the list into one and adds what a
full pass over the driver's firmware-supplied values turned up.  It
supersedes

  [PATCH v2 0/2] scsi: mvumi: bound two firmware-supplied lengths
  20261013173145.3412863-1-yhlee@isslab.korea.ac.kr

  [PATCH v4] scsi: mvumi: reject handshake sizes that overflow the list
  allocations
  20261014134104.3528958-1-yhlee@isslab.korea.ac.kr

and both of those can be dropped.

Everything the firmware writes reaches the driver either through the
handshake page, through the event buffer, or through a response frame in
the outbound list.  The patches follow that split:

 1  event buffer: param_count and sense_data_length index fixed arrays in
    mvumi_show_event().
 2  handshake page: frame_length drives the checksum walk, whose counter is
    an unsigned char, so 256 or more never terminates.
 3  event buffer: the hotplug bitmap size drives two find_next_zero_bit()
    scans with nothing holding it inside the 512-byte buffer.
 4  handshake page: the entry sizes and max_io size three allocations, the
    list depth drives the ring index, and a reset reports all of them
    again without reallocating anything.
 5  response frame: the tag indexes tag_cmd[], and the value that is
    checked and the value that is used are separate fetches of
    firmware-writable memory.
 6  handshake page: max_devices_support is a u16 and the loop counter
    mvumi_flush_cache() compares it against is an unsigned char.

Patch 6 depends on patch 4 and patch 5 reads better after it, so the order
matters; 1 to 3 are independent.

I have no mvumi hardware, so none of this is tested on a controller.  Each
patch's reasoning is from the source, and I modelled the arithmetic and the
loop bounds of every case in userspace, including the values that should
still be accepted.

v5:
- one series instead of two; supersedes the two above.
- new: bound the hotplug event bitmap (patch 3).
- new: validate the response frame tag (patch 5).
- patch 4 also rejects an entry size too small to hold the frames the
  driver puts in it, which is what made the max_sg subtraction in
  mvumi_io_attach() wrap.
- new: widen the flush cache loop counter (patch 6), which answers the
  review of the v4 posting above.

Yehyeong Lee (6):
  scsi: mvumi: bound the per-event parameter and sense dumps
  scsi: mvumi: reject an out-of-range handshake frame length
  scsi: mvumi: bound the hotplug event bitmap
  scsi: mvumi: reject handshake sizes that overflow the list allocations
  scsi: mvumi: validate the response frame tag before using it
  scsi: mvumi: widen the flush cache loop counter

 drivers/scsi/mvumi.c | 156 +++++++++++++++++++++++++++++++++++--------
 drivers/scsi/mvumi.h |   3 +
 2 files changed, 132 insertions(+), 27 deletions(-)


base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.43.0


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

end of thread, other threads:[~2026-10-14 16:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 15:19 [PATCH v5 0/6] scsi: mvumi: bound the values the firmware supplies Yehyeong Lee
2026-10-14 15:19 ` [PATCH v5 1/6] scsi: mvumi: bound the per-event parameter and sense dumps Yehyeong Lee
2026-10-14 15:32   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 2/6] scsi: mvumi: reject an out-of-range handshake frame length Yehyeong Lee
2026-10-14 15:33   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 3/6] scsi: mvumi: bound the hotplug event bitmap Yehyeong Lee
2026-10-14 15:35   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 4/6] scsi: mvumi: reject handshake sizes that overflow the list allocations Yehyeong Lee
2026-10-14 15:31   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 5/6] scsi: mvumi: validate the response frame tag before using it Yehyeong Lee
2026-10-14 15:33   ` sashiko-bot
2026-10-14 15:19 ` [PATCH v5 6/6] scsi: mvumi: widen the flush cache loop counter Yehyeong Lee
2026-10-14 15:38   ` sashiko-bot
2026-10-14 16:28 ` [PATCH v5 0/6] scsi: mvumi: bound the values the firmware supplies 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.