Commit 87c4b5e
scsi: storvsc: Set correct data length for sending SCSI command without payload
In StorVSC, payload->range.len is used to indicate if this SCSI command
carries payload. This data is allocated as part of the private driver data
by the upper layer and may get passed to lower driver uninitialized.
For example, the SCSI error handling mid layer may send TEST_UNIT_READY or
REQUEST_SENSE while reusing the buffer from a failed command. The private
data section may have stale data from the previous command.
If the SCSI command doesn't carry payload, the driver may use this value as
is for communicating with host, resulting in possible corruption.
Fix this by always initializing this value.
Fixes: be0cf6c ("scsi: storvsc: Set the tablesize based on the information given by the host")
Cc: [email protected]
Tested-by: Roman Kisel <[email protected]>
Reviewed-by: Roman Kisel <[email protected]>
Reviewed-by: Michael Kelley <[email protected]>
Signed-off-by: Long Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>1 parent f8fb240 commit 87c4b5e
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
| 1803 | + | |
1803 | 1804 | | |
1804 | 1805 | | |
1805 | 1806 | | |
| |||
0 commit comments