Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1299344pxu; Sat, 5 Dec 2020 10:38:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAg/bieM1ENxU3mSX38NHza9f1mlUUuXcMkFox//lqlap6niE2utnGnsCNtClnpeaq061f X-Received: by 2002:a05:6402:114b:: with SMTP id g11mr13218696edw.228.1607193491956; Sat, 05 Dec 2020 10:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607193491; cv=none; d=google.com; s=arc-20160816; b=BVCfv8RcSQZhApEHWmJnr3n5zbucXhPqjQU4ONHaifD9XKOSgRfKS2kuMVs1TPBDxn UHkPQkLvKDePonokjF5BOJn1C1YfYfPYggHQma98PvJ4WHLTrmYIacOfS1JdRaM/5f3O 1yQ/M4YTT7NwE9qKz1m9fuOUGJXqYUCF+ZlFctxCfrl3uh/5McY0xA2QZTbIyjg5a6SV 83XxM2T9uycZ58a78xvUeD5A3WCKGgPFOievEBPhuUZZbYEDY37PiY7OryA/r/jmB8JZ Ma+2Uyy9Rm3q/t2U4d2kq84Sj9FDtQ74tpyyJ3oo52z0Dsq9f5tnqC2weLt5fKQOUaqE aMtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:cc:to:from:subject:message-id:dkim-signature :dkim-signature; bh=XMYUKHpGo6eve27O8lLfxXTxyqRruWci7QMO4ugNYJY=; b=iYvWmtW4r5bafKXOqtQrySukbVVK8xi26MRNMxk03oNjWCcUHg66ZajoCy5LQRYAgV OFX7smr4aeLwijV5M8qt+8eC2BNAbdc8GqU0tCWjpvXhrNVdI3jw1wLFe7BlsvcqLSvZ qGNYSA5cUyLb+vFYE9X9zPjurLJittY8kbh6sFGUlThbitddTPqGqADBsyB4HmOQZydx kI18iLMDpDENypBwxQNMxoZZAI/AQf5HTOSG3fbz0VBTH67jT4jqg6+W3DvwxUxDTbiF a/ZRep6t+JqH0adEwRpbcuAKnRwO0N0WucMe9GIUFxZ7+LFWh3IIaLCG69whyZnMcgrR 4X+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=sw4ZNyO+; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=sw4ZNyO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si3441580ejf.542.2020.12.05.10.37.48; Sat, 05 Dec 2020 10:38:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=sw4ZNyO+; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=sw4ZNyO+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbgLEScf (ORCPT + 99 others); Sat, 5 Dec 2020 13:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728606AbgLES2z (ORCPT ); Sat, 5 Dec 2020 13:28:55 -0500 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [IPv6:2607:fcd0:100:8a00::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 499F8C02B8F5; Sat, 5 Dec 2020 09:30:33 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id CA3331280881; Sat, 5 Dec 2020 09:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1607189430; bh=ju+gwqxSbw4wAV2Be4ASi/eauxUvVwvTJ6wdfezRikM=; h=Message-ID:Subject:From:To:Date:From; b=sw4ZNyO+g5ST4XpJmRf6c8a8GvRnAqCt3Q2+OcRWiOG9GQQLtA9lF9mR+LYauTs8T +yzkLelUaNGUTBpSAr60r7/ECQs/rp12i7fQCX36noFErYQDdAfOwHEuPIMKSsMJxJ hlEFvLlpSSga3oooaIGg5ghLQ2arb5A7bZ5Os8Go= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id btD5y0INxwPt; Sat, 5 Dec 2020 09:30:30 -0800 (PST) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::527]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 6C0D01280857; Sat, 5 Dec 2020 09:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1607189430; bh=ju+gwqxSbw4wAV2Be4ASi/eauxUvVwvTJ6wdfezRikM=; h=Message-ID:Subject:From:To:Date:From; b=sw4ZNyO+g5ST4XpJmRf6c8a8GvRnAqCt3Q2+OcRWiOG9GQQLtA9lF9mR+LYauTs8T +yzkLelUaNGUTBpSAr60r7/ECQs/rp12i7fQCX36noFErYQDdAfOwHEuPIMKSsMJxJ hlEFvLlpSSga3oooaIGg5ghLQ2arb5A7bZ5Os8Go= Message-ID: <6241da59ba45eeb525203201095d1f5ee76fbceb.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.10-rc6 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Sat, 05 Dec 2020 09:30:29 -0800 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Andrea Parri (Microsoft) (1): scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback() Jing Xiangfeng (1): scsi: storvsc: Fix error return in storvsc_probe() Sreekanth Reddy (1): scsi: mpt3sas: Increase IOCInit request timeout to 30s Suganath Prabu S (1): scsi: mpt3sas: Fix ioctl timeout And the diffstat: drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- drivers/scsi/storvsc_drv.c | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index e4cc92bc4d94..bb940cbcbb5d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -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); diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 0f2b681449e6..edd26a2570fa 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -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; diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 0c65fbd41035..99c8ff81de74 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -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);