Commit 03b75e65 authored by Martin Wilck's avatar Martin Wilck Committed by Greg Kroah-Hartman

scsi: scsi_dh_rdac: zero cdb in send_mode_select()

commit 57adf5d4 upstream.

cdb in send_mode_select() is not zeroed and is only partially filled in
rdac_failover_get(), which leads to some random data getting to the
device. Users have reported storage responding to such commands with
INVALID FIELD IN CDB. Code before commit 32782557 was not affected, as
it called blk_rq_set_block_pc().

Fix this by zeroing out the cdb first.

Identified & fix proposed by HPE.

Fixes: 32782557 ("scsi_dh_rdac: switch to scsi_execute_req_flags()")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20190904155205.1666-1-martin.wilck@suse.comSigned-off-by: default avatarMartin Wilck <mwilck@suse.com>
Acked-by: default avatarAles Novak <alnovak@suse.cz>
Reviewed-by: default avatarShane Seymour <shane.seymour@hpe.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e21e5b2
...@@ -546,6 +546,8 @@ static void send_mode_select(struct work_struct *work) ...@@ -546,6 +546,8 @@ static void send_mode_select(struct work_struct *work)
spin_unlock(&ctlr->ms_lock); spin_unlock(&ctlr->ms_lock);
retry: retry:
memset(cdb, 0, sizeof(cdb));
data_size = rdac_failover_get(ctlr, &list, cdb); data_size = rdac_failover_get(ctlr, &list, cdb);
RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment