Subject: CVE-2021-47204: net: dpaa2-eth: fix use-after-free in dpaa2_eth_remove

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

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

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

net: dpaa2-eth: fix use-after-free in dpaa2_eth_remove

Access to netdev after free_netdev() will cause use-after-free bug.
Move debug log before free_netdev() call to avoid it.

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

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

	Issue introduced in 4.17 with commit 7472dd9f6499 and fixed in 5.4.162 with commit d74ff10ed2d9
	Issue introduced in 4.17 with commit 7472dd9f6499 and fixed in 5.10.82 with commit 1c4099dc0d6a
	Issue introduced in 4.17 with commit 7472dd9f6499 and fixed in 5.15.5 with commit 32d468622474
	Issue introduced in 4.17 with commit 7472dd9f6499 and fixed in 5.16 with commit 9b5a333272a4

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-47204
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/freescale/dpaa2/dpaa2-eth.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/d74ff10ed2d93dc9b67e99a74b36fb9a83273d8a
	https://git.kernel.org/stable/c/1c4099dc0d6a01e76e4f7dd98e4b3e0d55d80ad9
	https://git.kernel.org/stable/c/32d4686224744819ddcae58b666c21d2a4ef4c88
	https://git.kernel.org/stable/c/9b5a333272a48c2f8b30add7a874e46e8b26129c