scsi: target: keep command bytes inside the sg
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 0 repliesNew
- v18 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Keep data sg advancement before the escape check in patch 5.
- Retain the existing atomic page mappings in the DIF paths.
- Fix escape advancement with the existing cursor loop in patch 8.
- Use the existing sg copy helpers for pscsi mode data in patch 7.
- Correct the Fixes tags in patches 1, 3 and 5.
- Explain why PI generation reads an existing tuple before updating it.
- Shorten the commit descriptions and retain the relevant trace frames.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | scsi: target: take COMPARE AND WRITE data from the write halfdrivers/ drivers/ | +80 | 0 replies | |
| 2/8 | scsi: target: keep REPORT REFERRALS stores inside the bufferdrivers/ | +19 | 0 replies | |
| 3/8 | scsi: target: reject a short SET TARGET PORT GROUPS listdrivers/ | +3 | 0 replies | |
| 4/8 | scsi: target: copy a DIF insert tuple across prot sgsdrivers/ | +131 | 0 replies | |
| 5/8 | scsi: target: copy a DIF verify tuple across prot sgsdrivers/ | +58 | 0 replies | |
| 6/8 | scsi: target: limit DIF block CRC to each data sgdrivers/ | +42 | 0 replies | |
| 7/8 | scsi: target: keep pscsi mode bytes inside the data sgsdrivers/ | +17 | 0 replies | |
| 8/8 | scsi: target: advance past escaped DIF blocks across data sgsdrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/8] scsi: target: keep command bytes inside the sg
This series fixes eight target-core accesses past command-buffer or sg boundaries. vhost-scsi can supply guest buffers whose sg boundaries do not coincide with command fields, logical blocks or protection tuples.
Patch 1 builds the COMPARE AND WRITE write sg table from the entries that contain the write half.
Patch 2 limits each REPORT REFERRALS LBA store to the bytes remaining in the response buffer.
Patch 3 rejects SET TARGET PORT GROUPS parameter lists that end in a partial four-byte descriptor.
Patch 4 lets sbc_dif_generate() write an eight-byte protection tuple split across protection sg entries.
Patch 5 lets sbc_dif_verify() read a tuple split across protection sg entries and rejects a partial tuple at the end of the list.
Patch 6 limits each CRC update to the bytes available in the current data sg in both DIF generation and verification.
Patch 7 checks buffer lengths and uses sg copies for the pscsi MODE SENSE write-protect byte and tape MODE SELECT block descriptor.
Patch 8 makes sbc_dif_verify() advance past an escaped block spanning multiple data sg entries.
Patches 1, 2, 3 and 7 are independent. The DIF patches 4, 5, 6 and 8 fix separate bugs and are posted in that order: patch 4 can stand alone, patch 5 uses its tuple-copy helper, and patch 6 builds on both. Patch 8 covers escaped blocks, which bypass the CRC walk.
Changes in v2:
- Keep data sg advancement before the escape check in patch 5.
- Retain the existing atomic page mappings in the DIF paths.
- Fix escape advancement with the existing cursor loop in patch 8.
- Use the existing sg copy helpers for pscsi mode data in patch 7.
- Correct the Fixes tags in patches 1, 3 and 5.
- Explain why PI generation reads an existing tuple before updating it.
- Shorten the commit descriptions and retain the relevant trace frames.
Jia Jia (8):
scsi: target: take COMPARE AND WRITE data from the write half
scsi: target: keep REPORT REFERRALS stores inside the buffer
scsi: target: reject a short SET TARGET PORT GROUPS list
scsi: target: copy a DIF insert tuple across prot sgs
scsi: target: copy a DIF verify tuple across prot sgs
scsi: target: limit DIF block CRC to each data sg
scsi: target: keep pscsi mode bytes inside the data sgs
scsi: target: advance past escaped DIF blocks across data sgs
drivers/target/target_core_alua.c | 29 ++- drivers/target/target_core_pscsi.c | 37 ++- drivers/target/target_core_sbc.c | 422 ++++++++++++++++++++++----------- drivers/target/target_core_transport.c | 11 +- 4 files changed, 338 insertions(+), 161 deletions(-)