Skip to content

Commit 312b0bc

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Four small fixes in two drivers. The mpt3sas fixes are all problems with timeout under unusual conditions, and the storvsc is a missed incoming packet validation and a missed error return" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mpt3sas: Increase IOCInit request timeout to 30s scsi: mpt3sas: Fix ioctl timeout scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() scsi: storvsc: Fix error return in storvsc_probe()
2 parents 8762340 + 85dad32 commit 312b0bc

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6459,7 +6459,7 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc)
64596459

64606460
r = _base_handshake_req_reply_wait(ioc,
64616461
sizeof(Mpi2IOCInitRequest_t), (u32 *)&mpi_request,
6462-
sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 10);
6462+
sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 30);
64636463

64646464
if (r != 0) {
64656465
ioc_err(ioc, "%s: handshake failed (r=%d)\n", __func__, r);

drivers/scsi/mpt3sas/mpt3sas_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
664664
Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL;
665665
struct _pcie_device *pcie_device = NULL;
666666
u16 smid;
667-
u8 timeout;
667+
unsigned long timeout;
668668
u8 issue_reset;
669669
u32 sz, sz_arg;
670670
void *psge;

drivers/scsi/storvsc_drv.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,11 @@ static void storvsc_on_channel_callback(void *context)
12461246
request = (struct storvsc_cmd_request *)
12471247
((unsigned long)desc->trans_id);
12481248

1249+
if (hv_pkt_datalen(desc) < sizeof(struct vstor_packet) - vmscsi_size_delta) {
1250+
dev_err(&device->device, "Invalid packet len\n");
1251+
continue;
1252+
}
1253+
12491254
if (request == &stor_device->init_request ||
12501255
request == &stor_device->reset_request) {
12511256
memcpy(&request->vstor_packet, packet,
@@ -1994,8 +1999,10 @@ static int storvsc_probe(struct hv_device *device,
19941999
alloc_ordered_workqueue("storvsc_error_wq_%d",
19952000
WQ_MEM_RECLAIM,
19962001
host->host_no);
1997-
if (!host_dev->handle_error_wq)
2002+
if (!host_dev->handle_error_wq) {
2003+
ret = -ENOMEM;
19982004
goto err_out2;
2005+
}
19992006
INIT_WORK(&host_dev->host_scan_work, storvsc_host_scan);
20002007
/* Register the HBA and start the scsi bus scan */
20012008
ret = scsi_add_host(host, &device->device);

0 commit comments

Comments
 (0)