Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp406479pxu; Tue, 1 Dec 2020 14:28:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzY/AyilPjIyGLrDjzUt4RHJeUNZhbpB+Z0gUoeACKmUz2YFBZr3nG7qOR/hGsykdZoaRy X-Received: by 2002:a50:da84:: with SMTP id q4mr5156188edj.377.1606861691996; Tue, 01 Dec 2020 14:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861691; cv=none; d=google.com; s=arc-20160816; b=NlEJJSxHW5kO51DbWHaJHm6MAs3fxcAYEjeaHsXn2LwkDIFgVAsBtDKkXhgua8mS2j lDFUUlyZM3Pvg35C3oakvZCSy6let2wwGXy4iQDDben/WWzSJQwqnWF0fun9aQKqBMWn g9CTNr+ahk/kovrGKT8YgAqIXsQbl3PuXC/U5wSK4klOzwJOa8zU69SSuaK02vvF3YNj SpqIL8bEZOEamuQP0z3cmrylElgy7/bK43h78ZAjp8c5wvw4llCNDpBcQDJ2DKlFbRn1 XNH/nMA4OP3cjuob2e6Hoc8DyV+FGkmNl9kEOKuHhU0Q8cxcDVAULuCKBQX8V5TsDdzz cOHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U2k6v5ewbOa9EUx4qxCyKulMAMkxbPLm6J9MdFBb2Ks=; b=0RYB+6QPBARn51EjtcVGbsqvk0Cbb+3F2eG5JzzRtU+ZAUaDh7BEygy4IjdEVe4nY9 1NHVA6Zg4it1DM9G5u1NvBs73cf/kE0uPKFSHEslmILJkYsfxyUYHd64PlMCcEipSKmF j019ahbIjZZRy+j3PJ2ETJkoTEFACUZRDGpwx0c/f9CDBDYL33OSmcvDHU5lDFVXkKhd iHS8P/yk9nt+uY3GNOUK0ia0KLCUQbbhktSgXacO0WjXL6E5PPQ2KyG2tTvXWiWsspH/ Li0OyKXoi0jMXBz3v/9+XE4KmtjgaWAPkZNJDe/wcDBb2PpOgYyIQ+dCmz1wITJwGWYN Lokg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UjrILIhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si822404edh.105.2020.12.01.14.27.49; Tue, 01 Dec 2020 14:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UjrILIhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389875AbgLAJLy (ORCPT + 99 others); Tue, 1 Dec 2020 04:11:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:47718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389543AbgLAJLo (ORCPT ); Tue, 1 Dec 2020 04:11:44 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 0EE4C20770; Tue, 1 Dec 2020 09:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813883; bh=DKzJ8l27nwCgpSyAhsjwF0kAnIbc16qUSwJ0cyQpX0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjrILIhLmXf7wpiJOHvZDIzrd5h85jB2X1c5Z5zPLmVfJiyhi08sMod8hm8ppywd9 mPxlpvqO4S1CBVfeQf3ICWv4vb3Y3HNRhhQrsTGr1OlSbczBrfAMPzW/KrnyKkHtFg On/q6tj1uglSti+NQ0iou+qEZFPNOrgi4BqAaX/8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raju Rangoju , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.9 093/152] cxgb4: fix the panic caused by non smac rewrite Date: Tue, 1 Dec 2020 09:53:28 +0100 Message-Id: <20201201084724.070420315@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raju Rangoju [ Upstream commit bff453921ae105a8dbbad0ed7dd5f5ce424536e7 ] SMT entry is allocated only when loopback Source MAC rewriting is requested. Accessing SMT entry for non smac rewrite cases results in kernel panic. Fix the panic caused by non smac rewrite Fixes: 937d84205884 ("cxgb4: set up filter action after rewrites") Signed-off-by: Raju Rangoju Link: https://lore.kernel.org/r/20201118143213.13319-1-rajur@chelsio.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c index 8eb976106d0c8..7e7537eabf000 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c @@ -883,7 +883,8 @@ int set_filter_wr(struct adapter *adapter, int fidx) FW_FILTER_WR_OVLAN_VLD_V(f->fs.val.ovlan_vld) | FW_FILTER_WR_IVLAN_VLDM_V(f->fs.mask.ivlan_vld) | FW_FILTER_WR_OVLAN_VLDM_V(f->fs.mask.ovlan_vld)); - fwr->smac_sel = f->smt->idx; + if (f->fs.newsmac) + fwr->smac_sel = f->smt->idx; fwr->rx_chan_rx_rpl_iq = htons(FW_FILTER_WR_RX_CHAN_V(0) | FW_FILTER_WR_RX_RPL_IQ_V(adapter->sge.fw_evtq.abs_id)); -- 2.27.0