Subject: CVE-2021-47138: cxgb4: avoid accessing registers when clearing filters

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

cxgb4: avoid accessing registers when clearing filters

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.

The Linux kernel CVE team has assigned CVE-2021-47138 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.2 with commit b1a79360ee86 and fixed in 5.4.124 with commit 0bf49b3c8d8b
	Issue introduced in 5.2 with commit b1a79360ee86 and fixed in 5.10.42 with commit 02f03883fdb1
	Issue introduced in 5.2 with commit b1a79360ee86 and fixed in 5.12.9 with commit 285207a558ab
	Issue introduced in 5.2 with commit b1a79360ee86 and fixed in 5.13 with commit 88c380df84fb

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2021-47138
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/0bf49b3c8d8b3a43ce09f1b2db70e5484d31fcdf
	https://git.kernel.org/stable/c/02f03883fdb10ad7e66717c70ea163a8d27ae6e7
	https://git.kernel.org/stable/c/285207a558ab456aa7d8aa877ecc7e91fcc51710
	https://git.kernel.org/stable/c/88c380df84fbd03f9b137c2b9d0a44b9f2f553b0