Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp404184pxu; Tue, 1 Dec 2020 14:24:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzw4IIkLqH/xq/dgD6meQy/DD+PG8RMrpCSEOjAqPj38mruWDvuW4TWE3m6EIEQ1LU2lJl6 X-Received: by 2002:a17:906:6c94:: with SMTP id s20mr1473369ejr.0.1606861465033; Tue, 01 Dec 2020 14:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861465; cv=none; d=google.com; s=arc-20160816; b=hN8MRyFiSkCY3ePZbC4ZkWElgNrl5x7ruY9t9xAJihY2vEh/SedQK+bEN1EPM9Qcug P1uJ5E2KQM4nbNYJp8O3XFjoE+7HiVLVwdQZRIn2CIsJPLJURNxCmOFs+ZFkaQIuB0Vc fxEhexBXxde97QNmp0ShPUTyldKl+vq/q2rwEyt0DU4ZjdsP/TdePIbjhEicdmC9Pexd vd88n+gZJbe5Tpr1V1X3ZpZLX+kzyKJiDpavAkYxkHXHYfaOq6dtaryaPK0b0oFKkUv1 H2iP6Lm7t0QOskXLwRLLhjrat9pQk+Cs/dGTdrG1wQvgcphxTcz/4cUYilOYzEylRdOj cHQw== 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=lXltOBMH5aDgaeg/7b+SRyQkH0kKEW2ORJ9JmTRURpo=; b=cUXWHQPuBAU7pijYVhv+puseWZcO2tY/ba6LN7C6/W/DOVE2uMsrWQTFqdOXT0c3Al EN3XB5Aj1RahYD5Bb5D3tG5IHhwPTeMwHO7esonAq3Nyu9cl8V1LlSsTOYrUclightWw REdgMX8vdhtHldRRQNLFchA1tA+LGd3v9MX1tf3qoIfYXrVdeEyVdBwc9kJbSbBh9W8J nQg7i51/Qq6N+P10KFsX2EZ5VsD6KR/KdcBch4/kFEiARF7s3dlhS+Gi2YJcpwNpAlfb XKprr1vsVO1Pb3U1ROzI4Jv8pu4/s2L78rZl/S479D0LeamZ6XLL9JqfaIGv4BA/B3ge hiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O768hO3+; 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 rn21si850627ejb.130.2020.12.01.14.24.02; Tue, 01 Dec 2020 14:24:25 -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=O768hO3+; 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 S2388493AbgLAJHV (ORCPT + 99 others); Tue, 1 Dec 2020 04:07:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:40762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389054AbgLAJFG (ORCPT ); Tue, 1 Dec 2020 04:05:06 -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 0747E20770; Tue, 1 Dec 2020 09:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813485; bh=YA5Hb5iW4oPD5YG/PKpDlP0HxEPYoCp4gDPPfvoEFMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O768hO3+ZUDuxxd4PrNl/ow2jAPwibrjeiJkBjZpaKaFAukwnpDL/VdRvXG8p+cv1 F2wTVcTpHdRnrhwLGAymbyuRFLofddQxiV3/229GMyq0/f9ADzSl3yWA+9sUIoA3Gr TGZ76ZiufC4vfbCcmAmvUfgn8PZk0MwUedAWIfAQ= 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.4 54/98] cxgb4: fix the panic caused by non smac rewrite Date: Tue, 1 Dec 2020 09:53:31 +0100 Message-Id: <20201201084657.749144116@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084652.827177826@linuxfoundation.org> References: <20201201084652.827177826@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 202af8dc79662..cb50b41cd3df2 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c @@ -630,7 +630,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