Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp449875pxu; Fri, 11 Dec 2020 06:18:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJydu+VvRYtmZdXpqP0/PcHs0J6xr6qgu8MKHQboiSJpeStK+fjvohv0icEu4bAD0F4uuQgi X-Received: by 2002:a17:906:ce51:: with SMTP id se17mr11031141ejb.314.1607696331179; Fri, 11 Dec 2020 06:18:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607696331; cv=none; d=google.com; s=arc-20160816; b=V9Wl6uG5i0A6VmlMFFXfZ2qOqWzfaIMc7ezJgIjiP9aFU2YXGcTkHrcSlg7/GZ3cTD TdLhRdMsCx3Ph3+atvYblRQZtsp1bx6uZ+fRtOW27zgRYsIE0kdE5xRBZgEr9oD+IYxd I5aCQLUqnbB2dcu/xSez25oigFQJLy9TlmTtfHc3aEDRx4pA6hqVoI38qeXo7eW4KSOV 68zDhgGuaCuiPAZKZdBhKUl99CSHM9ct6AAF+F8ZwX8yAW3kziZm7+rA5mOyhzdXv0bn +hiXABFUv021m1aq+YhKPAwTQYqUUZjeQPoyg3FNfVWg3TIeL/huFQg/zVt1QEi8lesV mmnw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=P/PXvREWzGnG1B3AGlYhNPwfEngYC/155XNt7j1HiY4=; b=Et8C5bCaEopwO0PoTYnFwc0X+a+p4ig2cQ07YTIMA0PKMbPdqf6jd9BFGDvrKuVgRv VE5BDjz+7H0+CUMgeLaRkozOOkZjJbyMdwyHEp4v+zWtZtQhKEG0TnsHKmWM1wRvcaBY JekT30MqsN4g6mMUqzdifoUacUzvWGG/lpiPBz8T4R2DXYYGJzjXxmyvSQaotbWyJ1OI IR65kCxDLp+Vk66CRTig7ZyFWXYM1MKtD6WwMVomVGcUWXnJqN54UiGtOfjR6xPvDH+V 0/BcYmjz7tea3EghUNexR/bDRx1eypEoNgYxJpHUOLKALVk7zFkiEB9k35ejyABA+nQR /V4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b3304GJZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si4634252ejm.470.2020.12.11.06.18.26; Fri, 11 Dec 2020 06:18:51 -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=@gmail.com header.s=20161025 header.b=b3304GJZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436744AbgLKNP2 (ORCPT + 99 others); Fri, 11 Dec 2020 08:15:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404463AbgLKNPT (ORCPT ); Fri, 11 Dec 2020 08:15:19 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF36DC0613CF; Fri, 11 Dec 2020 05:14:38 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id ce23so12264179ejb.8; Fri, 11 Dec 2020 05:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/PXvREWzGnG1B3AGlYhNPwfEngYC/155XNt7j1HiY4=; b=b3304GJZrl9gVbA/sa3d6SWrH4NvzgrNYBmYaRGdyqUoL2ulxRsciA/4d6vAouT3eD W2NqWIIqDGCP7snYR96h/JvkMEMiHgMd+QsoufPqExebWtPgXS4DoJ6RGuTifvOuqotN ohDpT+IqeIh7VajSCXiZn8db/A/TxqHQrqnmfwqNnMyDOnjsQ8omXVSP5qCYGaAR5Zil 4vDZt+6GrKKinx6I4U90uiMbg5hISQxQ9urHHCaSRNjYHMnFdXvDnB2Qw0J2HS9zpp7o YSUxjRD42DMSpzF2II+rBjLOW7Iga45bL22ZLdcNiF3i89jx6Z4JM93suv/mnPXnfp2j y5sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/PXvREWzGnG1B3AGlYhNPwfEngYC/155XNt7j1HiY4=; b=SWogXB/ygXFsKBd50FoscsrrmUK11gMufGNjYNT5BYOaVPTL6TuO2NOfpapUadwv0T joLeIXF5l8LMMjIh+9HTU6K2hSpuA/d0HWeC/u22KSARBMqeAxHb5KLinq9vcuyrEmNZ 9X7zxCxaHMQPWveGQaVpldwQhJXLQ75ZBlC7Kdwq7Xf1bc3xMZBi9aT9krDQLNFLAMRF 6GPHx8tM+5Checu9tD4BLUif1VzQQ+AUmbgDhrINiN+fU2vc6zF7YleAA9UyLNrmxlNM FE2y8avtvqZsbXBx6+fycsZqJRzpWyncJUGdsNjVSzro8ZEnZj84xnfnBG0GNT+MXq8q SwJw== X-Gm-Message-State: AOAM533HNow44kuleVP0yYYisVuh8i1uepPIdVZqr2nVCExyigby729R huhN+CxSGU3+1Ps1ViDj8U7YTChpbQFIbtSm X-Received: by 2002:a17:906:7f10:: with SMTP id d16mr10835685ejr.104.1607692477085; Fri, 11 Dec 2020 05:14:37 -0800 (PST) Received: from localhost.localdomain (host-95-239-64-30.retail.telecomitalia.it. [95.239.64.30]) by smtp.gmail.com with ESMTPSA id v18sm7474948edx.30.2020.12.11.05.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Dec 2020 05:14:35 -0800 (PST) From: "Andrea Parri (Microsoft)" To: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Cc: "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Michael Kelley , "Andrea Parri (Microsoft)" , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH] Revert "scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()" Date: Fri, 11 Dec 2020 14:14:04 +0100 Message-Id: <20201211131404.21359-1-parri.andrea@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 3b8c72d076c42bf27284cda7b2b2b522810686f8. Dexuan reported a regression where StorVSC fails to probe a device (and where, consequently, the VM may fail to boot). The root-cause analysis led to a long-standing race condition that is exposed by the validation /commit in question. Let's put the new validation aside until a proper solution for that race condition is in place. Signed-off-by: Andrea Parri (Microsoft) Cc: Dexuan Cui Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org --- drivers/scsi/storvsc_drv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 99c8ff81de746..ded00a89bfc4e 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1246,11 +1246,6 @@ 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, -- 2.25.1