Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1980496imm; Thu, 24 May 2018 03:59:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqFJvkL6cN3T7T8XYDirHIMBMnbeNUtSt6sTBeAi34zHH4gTHtolzy8BigmcD87YTmSH+OY X-Received: by 2002:a65:4282:: with SMTP id j2-v6mr5423549pgp.189.1527159590160; Thu, 24 May 2018 03:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159590; cv=none; d=google.com; s=arc-20160816; b=dJve+t7BdSJs2ZFtg5DBq93pHiSxobyZOKJIMj2DcdbAJm4du0321bczc2GqCfC+t/ a/XoZiMufE59Twuwnxm4XdKQf8goNHoKX3tBiC1Xex76Mi555o36SS3T7J5txjAlgJEo weWrD2RsHlpTWoFBu6t+N2cu2jdmohBXQOcF+TjRL2Xs3BqePRgDX6ZZN4lZy4NntUYT iNcPLnEZQfhYQtYNDSSxd5wepPoyPJ74i+YXCWCc9revDPNf8PWtHZoTXoX+ROdrt65N hCkbEX9evNJR1vJbjol4bJUWFZAKsJxPPzQ7+ec9pm9TtePSK/iLad/tsGeNpkVMrldO 3ofQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=qAWPfylwybBxvLTgshJD9loJC6aEzxrI0Wj8mHw9Ibc=; b=X5MIvdH5pN/DOLzQ2DzJFNLJXeeTagJKAFI4tT0RtVB1DxqNfI4Aj5u3aTtiPVO98q rlPdHvvOTkyIEonUgmpLyv8SGeE0SJyZmJP0MYw9hst+aEzZrhK1h0m8JFqliiFnYj3g PPvCGp6iZVrL7dRLj+6W6HF4F/YnRGnzMQy2AaBR2XaebahHqnOVovylGKHNy7KRPpOR GELqqmF7H7UYiGHOm/IYpJSu/s5+pidAJX1QGOOHjl7bkUYXrYCw2Hi9f6ILSqEZvO4o WWWy8Ojwpm0D4sSUYvc6epvqgrrbqcxfh1l70ougZl/ieH+eLEEwHtgTs2QSxTcFFPHd zbjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E/E8KVMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8-v6si20640101plo.245.2018.05.24.03.59.35; Thu, 24 May 2018 03:59:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E/E8KVMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030220AbeEXJzz (ORCPT + 99 others); Thu, 24 May 2018 05:55:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:35856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030199AbeEXJzs (ORCPT ); Thu, 24 May 2018 05:55:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 866E8208B1; Thu, 24 May 2018 09:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155748; bh=KfZr+z7XNVWaLdtX0QfWJy4HieyZJxwtYpSszERH7CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/E8KVMO2RSIFJeYYxvuq/BPev1tEtfacVNmuk91roo2CoBFHyJuuBDTx+KQ3o3WL cuZfvfT1hvSb39htkYd2AR0yFjs/oGmToQ0dyUOw3Q0JNMOVn+SxUl+St0j8uDUMtZ ekrNYjaImjzJPzduzjhRTSdkUd9NJdwdx38t0Crc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chad Dupuis , Laurence Oberman , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 102/165] scsi: bnx2fc: Fix check in SCSI completion handler for timed out request Date: Thu, 24 May 2018 11:38:28 +0200 Message-Id: <20180524093626.145961914@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chad Dupuis [ Upstream commit ecf7ff49945f5741fa1da112f994939f942031d3 ] When a request times out we set the io_req flag BNX2FC_FLAG_IO_COMPL so that if a subsequent completion comes in on that task ID we will ignore it. The issue is that in the check for this flag there is a missing return so we will continue to process a request which may have already been returned to the ownership of the SCSI layer. This can cause unpredictable results. Solution is to add in the missing return. [mkp: typo plus title shortening] Signed-off-by: Chad Dupuis Reviewed-by: Laurence Oberman Tested-by: Laurence Oberman Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/bnx2fc/bnx2fc_io.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -1865,6 +1865,7 @@ void bnx2fc_process_scsi_cmd_compl(struc /* we will not receive ABTS response for this IO */ BNX2FC_IO_DBG(io_req, "Timer context finished processing " "this scsi cmd\n"); + return; } /* Cancel the timeout_work, as we received IO completion */