Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2525446imm; Mon, 28 May 2018 09:44:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKtfz/4V/zvXFOXhaCYKWVhx7N/FREKBYlCJH5he0sU4fEUJ09HKbS5/wEbuDzO4tuhyTYJ X-Received: by 2002:a17:902:b28:: with SMTP id 37-v6mr1315642plq.201.1527525891271; Mon, 28 May 2018 09:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527525891; cv=none; d=google.com; s=arc-20160816; b=uZXvIhXmvlaEum8zz8yrWB99csAA2wO3V2BA9Lq83l8Uvr4G43+A7IaauhE9PPo0b3 s9z94+UocklsnlJmcIMBwzbxBwluRiMFPHFM+QM+IyWKPlQoa18LD6MPc/VjJXiSqEQ9 u2sFNrCEteSYRAvca8wfS7b99dgr8ELo40tIv0nsWvBSfNrnqz6unS2hw752p3bNVewR fs15MSSZUH6PBDj+dylq8j3r97K7zwIOQJhTXGDaFrWqx6z+e8/Bhn9O5X8xpsEzQ0T0 dhoG6ClZzhPgIZm3qGqA2ngV+KjxT1Pe++FkWcTORyQCpW/uCVeBlmivVhRtN9Tf2+Sr ge0Q== 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=8DNUgPimEcueV3kO7N7fEtmJdm67XgASmNGP8cEqF4w=; b=PQbrvAs4r7KQ40duVWSaqvLzWYA+oPKg/wqjHFwJxuspwRt7aulGcsHRG22kZ0nJ74 w7/vEP1NJ45kLW3obJbMpEnL49L3e6MucEwOtLD30xtrMYZuKy777is/EmGK9ncNhMA+ V1AZFErveuFAvpTphOubjmRQ5wQPZYaPPdvsstTBKJ4bQIOIqClBl8dkHJeGgxajdGxy 7Gj+T+t+vBpasMC85eSX27TY+9dViD5IfxcfvB7XV4jh3x4HbKa8jb50P/2f/mwfmycG ttw0Z5G7+elFnq+SevpVHTGyUeq+VkhF9yUgqpV2fIWtjXXocIg4BvFLBYoMtsL/LIan en8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XJet8EcG; 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 o23-v6si29287196pll.54.2018.05.28.09.44.36; Mon, 28 May 2018 09:44:51 -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=XJet8EcG; 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 S940408AbeE1QnT (ORCPT + 99 others); Mon, 28 May 2018 12:43:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:55718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933304AbeE1KHk (ORCPT ); Mon, 28 May 2018 06:07:40 -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 28DFC20843; Mon, 28 May 2018 10:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502059; bh=0aV6N0RH1AfCBq22qUEAY0uk2whdFvJVyVyayMQ86nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJet8EcGKuYxieb2gaS4EpPCgv8Beut3ciCHyLa8sZ1TJQHJwCZ7YyssZQ1vZSOF5 qBxwfL8RG1+zp1+ITVySYN4oTfm0QTnNO8UbVjw+f2msw59QsY0dc9Qc0BLxt9RnB2 YPbgP97xDBQbc82B35gU/hupOn9Auzg9r+50XQVI= 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 3.18 047/185] scsi: bnx2fc: Fix check in SCSI completion handler for timed out request Date: Mon, 28 May 2018 12:01:28 +0200 Message-Id: <20180528100054.919043969@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -1932,6 +1932,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 */