Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2459036imd; Fri, 2 Nov 2018 11:46:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5dP245HN0/+89b6OpEWoKfzbL1PRFt9BQx9FPLPaDnbmqJ8nsNYw+BxhurDfCeSAmZ4t0+C X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr12393197plb.144.1541184364334; Fri, 02 Nov 2018 11:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184364; cv=none; d=google.com; s=arc-20160816; b=Z8j8C+5go+O0sr1999PBoGsPCDDQBHrq0G7ZhiZ/QsDqGBU/gXcU/ffTzztCYkAH5X pVY/C+t8LnNQx67+M9T1G61iBo9Wo2oj60sHH3clJUhCByzheOLpyB42Pt9uurqBQ06k j3U+rRjwkwGQijzt6hF1zJYhmrO7hWddDJ4rTedGP/sztn1Tu7ewUcIkI0zs4f2MsLbw tKbbjahf1BZ4EBEzx2fyCKCgj8+cRSzX5fpHc2J/fAk0h441M9zXWpm3WDbv79TJTH1K G2sNyQ7McgrWd5nB8ZqSJ+eN8KkAbsJCltz51FOezc4Civk6wjyEr0CHmbt6TCisNeQP cR6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FwOB4HtnMLoyC84RV0iAEB/oFN5+c0vOt2cRjGXSq3A=; b=ljg0zeUodTBAJADCJeCqg7Axr5t9fGiEzt9xJUksCinrMpt8jly3y75zfKXk3/Wsj5 qt/8SsRZx7tCHLVIJHvvaWTXE6+JAZnLNEV1nEPoKgtifUl5gHVd2Atq5YMNmg/HjSqZ TMxk3UtjvGfwSqxUF4ltPcwJzrhHA2nWd8PnsQx0m5wCBbZFKFeYMv56XvcFv7WSfnCJ xhnddzsRdgrMKaqJ4j1WTANBGl7CZOt0xqRBEia3IeQcMIsd2JuvFpUMtLgdcN+iOS+1 Bl2enmsD2MzSNz4fzvc3t41Lyhuw2zcLB1tFtQ7MOjDBpSnkjza6EGILu78ZOoU3tf91 ta4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=No3yiBHA; 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 i25-v6si34117757pgi.426.2018.11.02.11.45.49; Fri, 02 Nov 2018 11:46:04 -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=No3yiBHA; 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 S1730056AbeKCDw4 (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:48272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeKCDwz (ORCPT ); Fri, 2 Nov 2018 23:52:55 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 87B9F2084D; Fri, 2 Nov 2018 18:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184283; bh=ZoYqSZbtwksp4i1vDlQWTQGgxTEOXBKuOSiYwfb/p0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=No3yiBHARUoqd67rQayzgx5AOjx9hBt9RlXTqVKpEaMaVdUapW5nt4jK0C3F2M70a Ofod9wnYrjgGhQ4CoJYkLPieJ0eKRXYVwA9rhHsB6h6FFg2gUdTZDg3hTuePYAeAbq VHW9leuWsPsEG+7Nzi4cw279dLB5dSJswmgYISyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arthur Kiyanovski , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 089/150] net: ena: fix rare bug when failed restart/resume is followed by driver removal Date: Fri, 2 Nov 2018 19:34:11 +0100 Message-Id: <20181102182909.689201887@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9 ] In a rare scenario when ena_device_restore() fails, followed by device remove, an FLR will not be issued. In this case, the device will keep sending asynchronous AENQ keep-alive events, even after driver removal, leading to memory corruption. Fixes: 8c5c7abdeb2d ("net: ena: add power management ops to the ENA driver") Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 7093b661c50e..72dbdebf4b5d 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2648,7 +2648,11 @@ err_disable_msix: ena_free_mgmnt_irq(adapter); ena_disable_msix(adapter); err_device_destroy: + ena_com_abort_admin_commands(ena_dev); + ena_com_wait_for_abort_completion(ena_dev); ena_com_admin_destroy(ena_dev); + ena_com_mmio_reg_read_request_destroy(ena_dev); + ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); err: clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags); -- 2.17.1