Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1822086imm; Mon, 3 Sep 2018 10:19:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY0m4Ch70br1dO6F76hJHPAyFEy5YQTw6Mfh/Pt31/Y4z3Gf4w4BKVYoEM5uL/0m++jknZE X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr22704648plb.225.1535995146181; Mon, 03 Sep 2018 10:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995146; cv=none; d=google.com; s=arc-20160816; b=Wjw35/5HyNi3U4Gvdcr6VI8DdbBnHkVH1i/2lE6iIMgSJYjylbkVgj3Hwm9E8Q0sPt JIBwCFdgneI2j9JBRNJ9qXtfRo7dLytdlGs5H/TrIe8UzUeYh41Vkk0vJ31CqNh6rLGB SXLvx5I08FrckaP5mSYSBXvWeEZCdcGBCFikqdunE0oNOc8E7vCU2kW4LLHagJ7l23yN VFhLugRjqAuL/KUcRrkR9AshT3StFKaPKxQf22vdXWFNZhIbUS/Tdo3zx00Bl7Oyx2QS EBsGe3PbRjZstym2DLrmEG9D0GFFTAE/VoZ5orfTljnAex8IimF3fYp2IfOmqEBg8yym KOdw== 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 :arc-authentication-results; bh=6+/QKrz5jpiZrlQCcfvJLdjbxUcSleRSKiCOiseaUX8=; b=Dgf4zi0g0QiwReL6WyiIeCgdE8RApygCyyMleZ6UZuuIambPT0kJaJqZTY5q3+jT/3 dvK7A4tp47MimxQfwUskkCIi6ch9az1MSXPHO82EYxx7GsJu9MUdRF7Aj3pZgUhamVDO xmU4EKLxdjj+9Upvt5R9Np1Qzjwgz2Flt+WDGHZYUIkFvpl0W4pFZjUXEXyCcgqEPYbA PCyG/cuHdUneuanQ9PDwQFJ2EQytcdbzPTeWMqe7bd55BsU1OvlKsM67uL+ISDuvRbkb B1x6PNpCJnDuCudfJLRYtGJFXJl35YPJ0uKb3OHOIDn7w9DdIKPfZmOgVf7ZxJMgsIxK BCpw== ARC-Authentication-Results: i=1; mx.google.com; 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 f62-v6si18731140plf.164.2018.09.03.10.18.51; Mon, 03 Sep 2018 10:19:06 -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; 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 S1730164AbeICVi3 (ORCPT + 99 others); Mon, 3 Sep 2018 17:38:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42786 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728154AbeICVi2 (ORCPT ); Mon, 3 Sep 2018 17:38:28 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CA546D13; Mon, 3 Sep 2018 17:17:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudarsana Reddy Kalluru , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 044/165] bnx2x: Fix invalid memory access in rss hash config path. Date: Mon, 3 Sep 2018 18:55:30 +0200 Message-Id: <20180903165657.340421805@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudarsana Reddy Kalluru [ Upstream commit ae2dcb28c24794a87e424a726a1cf1a61980f52d ] Rx hash/filter table configuration uses rss_conf_obj to configure filters in the hardware. This object is initialized only when the interface is brought up. This patch adds driver changes to configure rss params only when the device is in opened state. In port disabled case, the config will be cached in the driver structure which will be applied in the successive load path. Please consider applying it to 'net' branch. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -3387,14 +3387,18 @@ static int bnx2x_set_rss_flags(struct bn DP(BNX2X_MSG_ETHTOOL, "rss re-configured, UDP 4-tupple %s\n", udp_rss_requested ? "enabled" : "disabled"); - return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); + if (bp->state == BNX2X_STATE_OPEN) + return bnx2x_rss(bp, &bp->rss_conf_obj, false, + true); } else if ((info->flow_type == UDP_V6_FLOW) && (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested; DP(BNX2X_MSG_ETHTOOL, "rss re-configured, UDP 4-tupple %s\n", udp_rss_requested ? "enabled" : "disabled"); - return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); + if (bp->state == BNX2X_STATE_OPEN) + return bnx2x_rss(bp, &bp->rss_conf_obj, false, + true); } return 0; @@ -3508,7 +3512,10 @@ static int bnx2x_set_rxfh(struct net_dev bp->rss_conf_obj.ind_table[i] = indir[i] + bp->fp->cl_id; } - return bnx2x_config_rss_eth(bp, false); + if (bp->state == BNX2X_STATE_OPEN) + return bnx2x_config_rss_eth(bp, false); + + return 0; } /**