Skip to content

scsi: mpi3mr: Fix issues reported by Sashiko

Ranjan Kumar linux-scsi sashiko-reviews 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 1 replyIn review
  2. v121 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Patch 14: Fixed the block_io count left raised when the last LUN is removed during the command, and the use after free of the SCSI target. Both were reported by Sashiko on v1.
- Patch 15: Reworked on top of patch 14 and documented the new member, as reported by Sashiko on v1.
- Patch 16: Documented the new lock, as reported by Sashiko on v1.
- Dropped patch 17 ("scsi: mpi3mr: Reject a too small reply size when enabling log data"). It is not needed because
commit e550f2b2b4aa ("scsi: mpi3mr: Validate reply frame size bounds") already rejects a reply frame smaller than 64 bytes.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20scsi: mpi3mr: Fix out-of-bounds read of the BSG requestdrivers/scsi/mpi3mr/mpi3mr_app.c+26 -00 replies
2/20scsi: mpi3mr: Fix integer wrap in BSG buffer entry lengthsdrivers/scsi/mpi3mr/mpi3mr_app.c+34 -10 replies
3/20scsi: mpi3mr: Remove redundant BSG buffer length checksdrivers/scsi/mpi3mr/mpi3mr_app.c+0 -230 replies
4/20scsi: mpi3mr: Fix PRP list leak in BSG passthroughdrivers/scsi/mpi3mr/mpi3mr_app.c+18 -60 replies
5/20scsi: mpi3mr: Fix reposting of invalid reply address on the admin queuedrivers/scsi/mpi3mr/mpi3mr_fw.c+8 -10 replies
6/20scsi: mpi3mr: Fix endianness of device handles in BSG requestsdrivers/scsi/mpi3mr/mpi3mr_app.c+5 -40 replies
7/20scsi: mpi3mr: Fix integer overflow in the HDB upload bounds checkdrivers/scsi/mpi3mr/mpi3mr_app.c+3 -10 replies
8/20scsi: mpi3mr: Fix integer overflow in the log data size calculationdrivers/scsi/mpi3mr/mpi3mr_app.c+2 -10 replies
9/20scsi: mpi3mr: Queue DEVICE_INFO_CHANGED events to the bottom half againdrivers/scsi/mpi3mr/mpi3mr_os.c+4 -00 replies
10/20scsi: mpi3mr: Fix target device reference leaksdrivers/scsi/mpi3mr/mpi3mr_os.c drivers/scsi/mpi3mr/mpi3mr_transport.c+12 -50 replies
11/20scsi: mpi3mr: Fix the 32 bit shift when building the phy maskdrivers/scsi/mpi3mr/mpi3mr_transport.c+5 -50 replies
12/20scsi: mpi3mr: Fix empty device list race in the all targets querydrivers/scsi/mpi3mr/mpi3mr_app.c+1 -10 replies
13/20scsi: mpi3mr: Fix the lowest phy number for phys 32 and abovedrivers/scsi/mpi3mr/mpi3mr_transport.c+14 -30 replies
14/20scsi: mpi3mr: Fix target private data use after free in BSG passthroughdrivers/scsi/mpi3mr/mpi3mr.h drivers/scsi/mpi3mr/mpi3mr_app.c drivers/scsi/mpi3mr/mpi3mr_os.c+73 -130 replies
15/20scsi: mpi3mr: Fix block_io accounting when a target is re-created during BSGdrivers/scsi/mpi3mr/mpi3mr.h drivers/scsi/mpi3mr/mpi3mr_app.c drivers/scsi/mpi3mr/mpi3mr_os.c+33 -230 replies
16/20scsi: mpi3mr: Fix sense buffer use after free on BSG command completiondrivers/scsi/mpi3mr/mpi3mr.h drivers/scsi/mpi3mr/mpi3mr_app.c drivers/scsi/mpi3mr/mpi3mr_fw.c +1 more+40 -81 reply
17/20scsi: mpi3mr: Fix partly written and lost entries in the log data bufferdrivers/scsi/mpi3mr/mpi3mr.h drivers/scsi/mpi3mr/mpi3mr_app.c drivers/scsi/mpi3mr/mpi3mr_fw.c +1 more+37 -120 replies
18/20scsi: mpi3mr: Fix byte order handling in the NVMe passthrough commandsdrivers/scsi/mpi3mr/mpi3mr_app.c+9 -90 replies
19/20scsi: mpi3mr: Fix byte order of the BSG status replydrivers/scsi/mpi3mr/mpi3mr_app.c+4 -20 replies
20/20scsi: mpi3mr: Use the correct conversion for the diag buffer post requestdrivers/scsi/mpi3mr/mpi3mr_app.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/20] scsi: mpi3mr: Fix issues reported by Sashiko

Fixes for issues in the mpi3mr driver reported by Sashiko.

Changes since v1:
- Patch 14: Fixed the block_io count left raised when the last LUN is removed during the command, and the use after free of the SCSI target. Both were reported by Sashiko on v1.
- Patch 15: Reworked on top of patch 14 and documented the new member, as reported by Sashiko on v1.
- Patch 16: Documented the new lock, as reported by Sashiko on v1.
- Dropped patch 17 ("scsi: mpi3mr: Reject a too small reply size when enabling log data"). It is not needed because
commit e550f2b2b4aa ("scsi: mpi3mr: Validate reply frame size bounds") already rejects a reply frame smaller than 64 bytes.

Ranjan Kumar (20):
scsi: mpi3mr: Fix out-of-bounds read of the BSG request
scsi: mpi3mr: Fix integer wrap in BSG buffer entry lengths
scsi: mpi3mr: Remove redundant BSG buffer length checks
scsi: mpi3mr: Fix PRP list leak in BSG passthrough
scsi: mpi3mr: Fix reposting of invalid reply address on the admin
queue
scsi: mpi3mr: Fix endianness of device handles in BSG requests
scsi: mpi3mr: Fix integer overflow in the HDB upload bounds check
scsi: mpi3mr: Fix integer overflow in the log data size calculation
scsi: mpi3mr: Queue DEVICE_INFO_CHANGED events to the bottom half
again
scsi: mpi3mr: Fix target device reference leaks
scsi: mpi3mr: Fix the 32 bit shift when building the phy mask
scsi: mpi3mr: Fix empty device list race in the all targets query
scsi: mpi3mr: Fix the lowest phy number for phys 32 and above
scsi: mpi3mr: Fix target private data use after free in BSG
passthrough
scsi: mpi3mr: Fix block_io accounting when a target is re-created
during BSG
scsi: mpi3mr: Fix sense buffer use after free on BSG command
completion
scsi: mpi3mr: Fix partly written and lost entries in the log data
buffer
scsi: mpi3mr: Fix byte order handling in the NVMe passthrough commands
scsi: mpi3mr: Fix byte order of the BSG status reply
scsi: mpi3mr: Use the correct conversion for the diag buffer post
request

 drivers/scsi/mpi3mr/mpi3mr.h           |  12 ++
 drivers/scsi/mpi3mr/mpi3mr_app.c       | 246 +++++++++++++++++--------
 drivers/scsi/mpi3mr/mpi3mr_fw.c        |  20 +-
 drivers/scsi/mpi3mr/mpi3mr_os.c        |  82 ++++++++-
 drivers/scsi/mpi3mr/mpi3mr_transport.c |  34 ++--
 5 files changed, 302 insertions(+), 92 deletions(-)
Signature · 1 line
2.47.3