Skip to content

Megasas: fix OOB access and NULL dereference issues

P J P qemu-devel 2 versions – Applied

Status from this message: Queued, thanks (but see my comment on patch 2).

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 10 repliesApplied
  2. v12 patches 20 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3megasas: use unsigned type for reply_queue_head and check indexhw/scsi/megasas.c+2 -23 replies
2/3megasas: avoid NULL pointer dereferencehw/scsi/megasas.c+1 -15 replies
3/3megasas: use unsigned type for positive numeric fieldshw/scsi/megasas.c+19 -191 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAlexander BulekovDarren Kenny
1/3A-b
2/3A-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Megasas: fix OOB access and NULL dereference issues

From: Prasad J Pandit <[email protected]>

Hello,

* First patch fixes an OOB access issue which may occur when a guest user sets 'reply_queue_head' field to a negative or large positive value, via 'struct mfi_init_qinfo' object in megasas_init_firmware(), such that 'index' variables in megasas_lookup_frame() goes beyond the s->frames[MEGASAS_MAX_FRAMES=2048] array bounds.
-> https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg03131.html

* Second patch fixes a NULL pointer dereference issue which may occur if megasas_enqueue_frame() routine returns a NULL frame for a given 'frame_addr' address.
-> https://bugs.launchpad.net/qemu/+bug/1878259

* Third patch updates other numeric fields of MegasasState to unsigned type.

Thank you.
--
Prasad J Pandit (3):
megasas: use unsigned type for reply_queue_head and check index
megasas: avoid NULL pointer dereference
megasas: use unsigned type for positive numeric fields

 hw/scsi/megasas.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

--
2.25.4