Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2177955imm; Mon, 28 May 2018 03:18:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpmWY9tohF/WOqXce+gtCmVRBlB1NUua+/mbZZyBCsjBjYZufrPuELGPUxyQzTa0fwQYhJZ X-Received: by 2002:a62:2197:: with SMTP id o23-v6mr13009846pfj.202.1527502733887; Mon, 28 May 2018 03:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527502733; cv=none; d=google.com; s=arc-20160816; b=GCelqnNaZJV33ae/8oiPwk7FgmoNdttFDvkkpI+8Z2oz3qnU2NpdkRbAc2FeBa5LTf 7wDDAnPSQjQ68hz+FjJSpdw0GX9UQyemMVVGkK97g43av5UzX3aqEg02cyH25WsGxkN9 Vrmn8iXcmPJZQurckRJA45jq1+Xhwj+QROp8gC00zjLiYXQOkdLrqbQWVSSYlTwPeLjX KqkODsYmG772z9E5gWENbXl9resDhleV8mfLBaDL0piPDb8vyz2+uIPX7ewv5HXhErKd B/ERTq+9PsqpY/JuMY8oHESZdDIaMeG5tPJCYx8esgWSpqRQCeAosUTTXfIha3qPuMGk Jf5Q== 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=wgnKzNFCCteU5CD66x3epG+BpTydBfYzvQh7iLuGkME=; b=Sw4IxawpElZoaRklTy4QjrgLNBOFCmz0ROxZ7d3UgzqV4Sl2pnCsB5XuoqS58wxZPR UTpXahMZ5oANg4pf/QznPDQvz262K67lDZEjJC9vr2iChQ+X4+yZP6rOQ66ySn7b6Mao rpvXc+KAHPDehnFV+j4itODSeQcL0xeOH2cLPruEYV8u2dLwbwk+F8tcho28sk8uDETw d9Kb/hS3+rbXwi2kOogMgmWgsXZos2PpxP13R+bbTw9tqUbFD1fER71NDknkpRHpaxcz 2rnpFVrNMWidqSRTDQYtYnMj6sSeK7Rg+eeIA7GeKhfECcetVRgtFyYp1H7r+BK9JrB6 LEOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sUuZ1hLJ; 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 j11-v6si23921435pgt.497.2018.05.28.03.18.39; Mon, 28 May 2018 03:18:53 -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=sUuZ1hLJ; 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 S968073AbeE1KRX (ORCPT + 99 others); Mon, 28 May 2018 06:17:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:37466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968655AbeE1KRT (ORCPT ); Mon, 28 May 2018 06:17:19 -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 C3B6120876; Mon, 28 May 2018 10:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502639; bh=OI816jCovaO7v3Bryk28chJq3uXK77U31DfDb+vdYlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sUuZ1hLJ26AT7lcX+pZiWKSXLgLamjT1nYVhYRcobpFlliSwn97weIsEnHdWeSdis vYQjsJJv2QBWtjDmlvjrWzImbXfFbYeGskc2YY9Txphja2A2XtHas+pQy0JdEeOwVa i29SfVGns+S4A5G4CCdkn9vkjM7bWmrhiOM2Os6U= 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.4 073/268] scsi: bnx2fc: Fix check in SCSI completion handler for timed out request Date: Mon, 28 May 2018 12:00:47 +0200 Message-Id: <20180528100210.092578879@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@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.4-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 @@ -1858,6 +1858,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 */