Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp51946pja; Fri, 22 Nov 2019 03:20:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwYbhLjL5vaL/prwbtlH/0bH4qnBPuK6R7I8XLoThs0Q/TOIfLhwO2iVfwVwMfDVFQPVmlq X-Received: by 2002:a17:906:cc93:: with SMTP id oq19mr21620487ejb.316.1574421608604; Fri, 22 Nov 2019 03:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421608; cv=none; d=google.com; s=arc-20160816; b=bhAU099ARhu+sHn3Tq4xaoX3zzMevgGAOEByqxZV/HXWAtXBhZibxIW6TmBCZwP/12 1YKz5E0Dmds81keThuTOHG16ubjLnlCo7xUDBpKljCZLgO1QWpqaWHXdortlD+AbmGwR OGqsuSlgFO6WnZ+liDom7tckFIwdEYhtf/fidS/49oAtsZotJSfrS1pqtdOd/iZCWlvZ 3peL9G3tfJjTvodL8unZ0/Gj282/5+usPiaJTH3rAk+MlSeTQRY7luaqQ4aUGTTTWnoY zWA96EZVqH6450Do4kDXMLpWIHjiXeoZ/e2MqHFhLvpQFfJ1EQHGqzdEhN8QJTACVd+e tc3Q== 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=n+pi4y3drptBB4BUeOQuFM6rdcbFXP9bD5GtVf6RpZ0=; b=O5/R3yq3vmWGlM3BMyDMgO9df4osOyU0n2Vr8niwfHSOT/Y4FM7+Q5ROv6uUVUvstH 4MPEzlBgHwtpIdan8MN21Cf5SMrgN+L7ZPJcPcJX8Wx3lH7fuch1BuJ1Dp88FlhCDbO9 Xh4C49EUxeabB0GchZehdydPGF38AuFwM2NbDpCqF4/jDfXBjmDHILF36iL7ITrqo+1L vYeBQJ6NRB37wAuuIp9kNQAblwmAQeK07b7bz3URWgixz8qBb26/JCu0Oja/gwczCzVm Lo0hR1m+t/XEzccKcXKZk4LxQMguvx9sgkAtQy57Twz7/zSILHZJJS085FYxYQlBFuUa mj7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="J/8fA6K6"; 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 w7si4727754edj.96.2019.11.22.03.19.44; Fri, 22 Nov 2019 03:20:08 -0800 (PST) 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="J/8fA6K6"; 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 S1730111AbfKVKv7 (ORCPT + 99 others); Fri, 22 Nov 2019 05:51:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:35090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730052AbfKVKv4 (ORCPT ); Fri, 22 Nov 2019 05:51:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 D490920718; Fri, 22 Nov 2019 10:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419915; bh=ZbNF/HOQmAyS7qUPtr8/B5e3AqtF1X/+pA8iO8KsUvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/8fA6K62DA0bBCHtVenTk3inA1Pi10Wd8xtLCRV0SUV7hbwaHNFR7OjMXT6RO1H8 SclfbT+YUby+3h0Kmj9zbSe1Ow8taelW8hWE/uSdzmz2kRVoA+qtyroyMDHwWsdONc cb0N/rVVtRWpVdx6mYuaCJMK4Dpy0/EzfM/to9g4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Radoslaw Tyl , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 052/122] ixgbe: Fix crash with VFs and flow director on interface flap Date: Fri, 22 Nov 2019 11:28:25 +0100 Message-Id: <20191122100758.163588358@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100722.177052205@linuxfoundation.org> References: <20191122100722.177052205@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Radoslaw Tyl [ Upstream commit 5d826d209164b0752c883607be4cdbbcf7cab494 ] This patch fix crash when we have restore flow director filters after reset adapter. In ixgbe_fdir_filter_restore() filter->action is outside of the rx_ring array, as it has a VF identifier in the upper 32 bits. Signed-off-by: Radoslaw Tyl Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index d1472727ef882..4801d96c4fa91 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -5129,6 +5129,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) struct ixgbe_hw *hw = &adapter->hw; struct hlist_node *node2; struct ixgbe_fdir_filter *filter; + u64 action; spin_lock(&adapter->fdir_perfect_lock); @@ -5137,12 +5138,17 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) hlist_for_each_entry_safe(filter, node2, &adapter->fdir_filter_list, fdir_node) { + action = filter->action; + if (action != IXGBE_FDIR_DROP_QUEUE && action != 0) + action = + (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1; + ixgbe_fdir_write_perfect_filter_82599(hw, &filter->filter, filter->sw_idx, - (filter->action == IXGBE_FDIR_DROP_QUEUE) ? + (action == IXGBE_FDIR_DROP_QUEUE) ? IXGBE_FDIR_DROP_QUEUE : - adapter->rx_ring[filter->action]->reg_idx); + adapter->rx_ring[action]->reg_idx); } spin_unlock(&adapter->fdir_perfect_lock); -- 2.20.1