Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2680127pxj; Mon, 31 May 2021 08:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ6AsdadxKJO0IPOP7E3Nf6QFYwu0xcBPe6yet1KVwF89G+aXIVvoDTuJHR4yH+So3ptIu X-Received: by 2002:a05:6402:294:: with SMTP id l20mr23221280edv.120.1622473606760; Mon, 31 May 2021 08:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473606; cv=none; d=google.com; s=arc-20160816; b=pXNr5OExm2YVKF72IVnHvo2JwcDMiUnMHFTBTkaGxA7fpYg+HLIX801VtMl6mg5jXq neOO7P1dJcNWX9Yz/D8maJXIMJqY/HKlHbHarlP2c50IBcKvqWL4f6uk5Gyr3miGMM+s l8BT+zg7pm8CfLHgApRx32MYm+4tUrDimQBru8HWHrRvaYWgqFuVMu4KhA1bBery3M8T ZqImgsxih3xWPuj5/ZeUpkToV9e7/1XRiZCl1crwkeB3OoeQiKrpU9Ixx6r0BdC0shOJ tucFrTT0lQQzuAClPpjadbrg+uIFAFSoc3zUtoVZBjr5LZtUeqc0geMKCM/rvnif+1Xn Or4Q== 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=AHmQgY7Hq+rQe576Wut69sHPeVEjphz4H7cklzdVgbg=; b=PckRuEbEUg5a6ipxR5kgGW8IYCZ1oKdhWqq/Q/5UY9IDHqzzj5WPLlQtVu0makLOhW Lyc4i9449EXN/IBlbhDgwnD9T+5YoKFWaq1gTjvAPQLm8SyoHaVg26GkFP2Enc6YJ+p4 LZClavU9FNVE/E29uPAT8n/qBfES/xYAIvGhSArmW1MC5ILQBsGzty0K/uQsVZvn0kWe Pus/yH1+FeQ2H0LSd92bisVcFx505m5I0mwg3upjvdK7ZvjqZmaSLf0aS/nyP5Uh+rIn Go7xGnl5tBtAyatpdItEuN2RMD7m/yZYXcrccOMWGxn94ZuvOyNuu8Ad7KW78QL0Fmqw bDYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="N/AxO9RG"; 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 j22si14525527eds.591.2021.05.31.08.06.23; Mon, 31 May 2021 08:06:46 -0700 (PDT) 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="N/AxO9RG"; 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 S233932AbhEaPG4 (ORCPT + 99 others); Mon, 31 May 2021 11:06:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:40812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233141AbhEaOIj (ORCPT ); Mon, 31 May 2021 10:08:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CEFAE6196C; Mon, 31 May 2021 13:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468394; bh=e9Kvj+llEdXdE4vFZ3aybTT3zMofuM2ZWeu75cRbXRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/AxO9RGI5Hwb+PXB2E+VtjGvCRkacQ/VxbOe5+454X6HEaAKkuydit2bOT7BXxLJ dSAw7egpim6SbQi2MzdZs0Q5KeSyn4lw3dG805Dp/D5AxvlLNjuss5rOl5s1dfgfUV hwAa8sYyr3Pg13oPKIguo4TaE1uyck0fQ+dYHbtM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raju Rangoju , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 225/252] cxgb4: avoid accessing registers when clearing filters Date: Mon, 31 May 2021 15:14:50 +0200 Message-Id: <20210531130705.638995400@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 88c380df84fbd03f9b137c2b9d0a44b9f2f553b0 ] Hardware register having the server TID base can contain invalid values when adapter is in bad state (for example, due to AER fatal error). Reading these invalid values in the register can lead to out-of-bound memory access. So, fix by using the saved server TID base when clearing filters. Fixes: b1a79360ee86 ("cxgb4: Delete all hash and TCAM filters before resource cleanup") Signed-off-by: Raju Rangoju Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c index bde8494215c4..e664e05b9f02 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c @@ -1042,7 +1042,7 @@ void clear_all_filters(struct adapter *adapter) cxgb4_del_filter(dev, f->tid, &f->fs); } - sb = t4_read_reg(adapter, LE_DB_SRVR_START_INDEX_A); + sb = adapter->tids.stid_base; for (i = 0; i < sb; i++) { f = (struct filter_entry *)adapter->tids.tid_tab[i]; -- 2.30.2