+9
−1
Loading
Some SCSI commands such as INQUIRY may generate an odd number of bytes in its response, not evenly divisible by 4. But iSCSI must align all transfer-in PDUs to 4-byte multiple. After enabling DPDK ASAN, we discover that the SCSI task response buffer was allocating exactly the size of the INQUIRY reponse, but iSCSI rounds this up, and ends up doing a sendmsg() off the end of the buffer for those trailing bytes. We could try to fix this in iSCSI layer, but it makes the code more complex - it would need to allocate some separate buffer for those extra bytes, or allocate a new buffer and copy the bytes over. So instead fix this down in the SCSI layer when the buffer is allocated, still report the iov_len as the smaller amount, but allocate an actual buffer that is rounded up to the nearest 4. Fixes issue #3203. Signed-off-by:Jim Harris <jim.harris@samsung.com> Change-Id: I702fe1b543c95388fa1dfa8c7cafb2538917479f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20853 Community-CI: Mellanox Build Bot Reviewed-by:
Changpeng Liu <changpeng.liu@intel.com> Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com>