From patchwork Fri Apr 28 15:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 678320 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B632FC77B60 for ; Fri, 28 Apr 2023 15:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346484AbjD1PiY (ORCPT ); Fri, 28 Apr 2023 11:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbjD1PiG (ORCPT ); Fri, 28 Apr 2023 11:38:06 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D8C1FFB for ; Fri, 28 Apr 2023 08:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1682696268; x=1714232268; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zsbmEiKjVEtmwafFll/j0inDMfzvsnh/8ANvZnHKc94=; b=SuE5UJ0txjObPmuDseHiLvt2Ot1rY/hqgLUJH0IvZCCwtAMKjorzBGN2 kkxC4DdFqCq/b7TXbfMtCn19fh6rGcCR1UPvcDVMrpi8rQGrtDPJj0qB4 MH++x+E1MSZUAZHlqV+j2zodC6WmBPPpCcJkUyI6Oz5oE4gxFNS4IHtwj 2QEBi8GlpFwshs/eyJ4fjCSsnIFTYq+BDELc5VXiolk7PUPMLKj+T4Vlm td84PdyvK+Kj99iW3cxiBUpG/uhGy0BjHJHqiamFq7unGRRa8jV5T8y+8 JM0vR5fYmI4ejdST9eRQ1qR9uv5HCa/fJ6tQC/O8OJQ03PdDVsUjLyU+z Q==; X-IronPort-AV: E=Sophos;i="5.99,234,1677567600"; d="scan'208";a="208806416" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Apr 2023 08:37:03 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 28 Apr 2023 08:37:02 -0700 Received: from brunhilda.pdev.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 28 Apr 2023 08:37:01 -0700 From: Don Brace To: , , , , , , , , , , , , , , , CC: Subject: [PATCH 06/12] smartpqi: validate block layer host tag Date: Fri, 28 Apr 2023 10:37:06 -0500 Message-ID: <20230428153712.297638-7-don.brace@microchip.com> X-Mailer: git-send-email 2.40.1.375.g9ce9dea4e1 In-Reply-To: <20230428153712.297638-1-don.brace@microchip.com> References: <20230428153712.297638-1-don.brace@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Murthy Bhat Prevent OS crashes when a drive is hot removed during IO stress test. IO request pointer can be invalid if block layer provides incorrect multi-queue host tag. This can lead to invalid IO request pointer dereference. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Mike McGowen Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 7fe80bef1a15..f76b5a3e0fd1 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -708,7 +708,8 @@ static inline struct pqi_io_request *pqi_alloc_io_request(struct pqi_ctrl_info * } } - pqi_reinit_io_request(io_request); + if (io_request) + pqi_reinit_io_request(io_request); return io_request; }