linux-stable/drivers/target
Mike Christie ccd3f44905 scsi: target: Fix WRITE_SAME No Data Buffer crash
In newer version of the SBC specs, we have a NDOB bit that indicates there
is no data buffer that gets written out. If this bit is set using commands
like "sg_write_same --ndob" we will crash in target_core_iblock/file's
execute_write_same handlers when we go to access the se_cmd->t_data_sg
because its NULL.

This patch adds a check for the NDOB bit in the common WRITE SAME code
because we don't support it. And, it adds a check for zero SG elements in
each handler in case the initiator tries to send a normal WRITE SAME with
no data buffer.

Link: https://lore.kernel.org/r/20220628022325.14627-2-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-07-07 16:38:14 -04:00
..
iscsi SCSI misc on 20220524 2022-05-25 19:09:48 -07:00
loopback
sbp
tcm_fc
Kconfig
Makefile
target_core_alua.c
target_core_alua.h
target_core_configfs.c scsi: target: Allow changing dbroot if there are no registered devices 2022-04-06 22:31:57 -04:00
target_core_device.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c scsi: target: Fix WRITE_SAME No Data Buffer crash 2022-07-07 16:38:14 -04:00
target_core_file.h
target_core_hba.c
target_core_iblock.c scsi: target: Fix WRITE_SAME No Data Buffer crash 2022-07-07 16:38:14 -04:00
target_core_iblock.h
target_core_internal.h
target_core_pr.c
target_core_pr.h
target_core_pscsi.c blk-mq: remove the done argument to blk_execute_rq_nowait 2022-05-28 06:15:27 -06:00
target_core_pscsi.h scsi: target: pscsi: Remove struct pscsi_plugin_task 2022-03-01 22:21:49 -05:00
target_core_rd.c
target_core_rd.h
target_core_sbc.c scsi: target: Fix WRITE_SAME No Data Buffer crash 2022-07-07 16:38:14 -04:00
target_core_spc.c scsi: target: core: Silence the message about unknown VPD pages 2022-04-25 22:33:36 -04:00
target_core_stat.c
target_core_tmr.c
target_core_tpg.c
target_core_transport.c
target_core_ua.c
target_core_ua.h
target_core_user.c scsi: target: tcmu: Avoid holding XArray lock when calling lock_page 2022-05-19 20:16:27 -04:00
target_core_xcopy.c
target_core_xcopy.h