Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2021350imm; Thu, 24 May 2018 04:39:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr00n6yi9grE4j+9V/EFzoZUbtiASp4IsPWbeDcEFxgJvSdvGLSRZWpPA5tsYM0pZEWqJS4 X-Received: by 2002:a17:902:b409:: with SMTP id x9-v6mr7138111plr.180.1527161971454; Thu, 24 May 2018 04:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161971; cv=none; d=google.com; s=arc-20160816; b=W7qb3jRTivXBwVsiAFyXPe24aQBwiE84wg3+YLo0bAeuxoJxaAGn8ITipsHbywLg96 4zRMvRFT8RC9N1Af06CsH10644hb73hwFrWUgN+zzUkQICdwN0CJHAWfYMmV/X2HAcQT ht24QwQqk9ODNUfNPN5rAmu0TgVm1pPbfffOhFwxKFNAZLf/6R7y43MVNHXL6Z09Lz8Z 1Oy2wvnrOwhUEw/PeUGtx3hMoeIhtpHPWitqlNLVjUHwnSoCt+PK7B3ISRsHDFkroqfd dnFCkejSsCzvOMrkzRPiGT064ek38JjaGz2oNmapQt/ysNsOwf5IQMsOzwyyPWyZ4h26 Wu3w== 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=OtnT9EctqtAgxPRd3Di8YKbvUiSbUYKfLjLfTwCYrqA=; b=UEKQLbK4d69W9zcXasIyrl4TsOe9WRNcY06zFjdYuMtE3ukKIpPeDBcHllJvLugPa7 SxZLmMjSkKi1IySYYJRqpjIe5/JrQD/RBnJ4ypgcYT8kLdHfQctHpKdT8jCH0o6r/dgd OXRiEH36uPUJxWqx2/4gw/7QxrH0k0S4JYekurqgwX/WLGRYqfrExK9tOoaqwlcPsAtg BYY4nv38V7ibMzVmhhgNQqkgriT5QFQMwUiCp55DNZU/IxQ1Bq7htSI4BHDRp83G1w2p qMkd853KHYHF+v/zFdLIQqLuJ8CXADtD55WquxTaqYp8H6oJNoawQMuGGcPIFGlayAlj 1dfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d8So+MTp; 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 t1-v6si4160158plq.341.2018.05.24.04.39.16; Thu, 24 May 2018 04:39:31 -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=d8So+MTp; 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 S967358AbeEXJtS (ORCPT + 99 others); Thu, 24 May 2018 05:49:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:36930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967308AbeEXJtL (ORCPT ); Thu, 24 May 2018 05:49:11 -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 7DA1720847; Thu, 24 May 2018 09:49:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155351; bh=wC5BhIOK5uTevPz7n3v+kjEJJ1fBrOpd+s2kCcKdr9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d8So+MTpJhwqy7YjJFIcufWoVoLRW47loufyv2En9rdpj1RaLNr2ThZmhY/3w3xNg M8ABcCG3UgPf1XjiAevcNWeOcCckHc7otYaMuEiM34gCCHV4MwuqbQ/gC/SnbKqwhc 69089WUmgv8R+WEWJrfIWNwA+f9uvSGbCZ0u0+Jk= 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.9 53/96] scsi: bnx2fc: Fix check in SCSI completion handler for timed out request Date: Thu, 24 May 2018 11:38:36 +0200 Message-Id: <20180524093608.545099158@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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 @@ -1869,6 +1869,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 */