SCSI fixes on 20201205

Four small fixes in two drivers.  The mpt3sas fixes are all timeout
 under unusual conditions problems and the storvsc is a missed incoming
 packet validation and a missed error return.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCX8vDDSYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishTRAAP9BAWjp
 kqf2tL9RdIG77IGUxWjHBEa2G2kaFyGli4+z6AEA15WwxaNMTgOg2ldKOOuCYB5i
 93+bClqG7BKs7LMHlUs=
 =Cdhq
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Linus Torvalds 2020-12-05 10:59:21 -08:00
commit 312b0bcd40
3 changed files with 10 additions and 3 deletions

View File

@ -6459,7 +6459,7 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc)
r = _base_handshake_req_reply_wait(ioc,
sizeof(Mpi2IOCInitRequest_t), (u32 *)&mpi_request,
sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 10);
sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 30);
if (r != 0) {
ioc_err(ioc, "%s: handshake failed (r=%d)\n", __func__, r);

View File

@ -664,7 +664,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg,
Mpi26NVMeEncapsulatedRequest_t *nvme_encap_request = NULL;
struct _pcie_device *pcie_device = NULL;
u16 smid;
u8 timeout;
unsigned long timeout;
u8 issue_reset;
u32 sz, sz_arg;
void *psge;

View File

@ -1246,6 +1246,11 @@ static void storvsc_on_channel_callback(void *context)
request = (struct storvsc_cmd_request *)
((unsigned long)desc->trans_id);
if (hv_pkt_datalen(desc) < sizeof(struct vstor_packet) - vmscsi_size_delta) {
dev_err(&device->device, "Invalid packet len\n");
continue;
}
if (request == &stor_device->init_request ||
request == &stor_device->reset_request) {
memcpy(&request->vstor_packet, packet,
@ -1994,8 +1999,10 @@ static int storvsc_probe(struct hv_device *device,
alloc_ordered_workqueue("storvsc_error_wq_%d",
WQ_MEM_RECLAIM,
host->host_no);
if (!host_dev->handle_error_wq)
if (!host_dev->handle_error_wq) {
ret = -ENOMEM;
goto err_out2;
}
INIT_WORK(&host_dev->host_scan_work, storvsc_host_scan);
/* Register the HBA and start the scsi bus scan */
ret = scsi_add_host(host, &device->device);