Subject: CVE-2022-48960: net: hisilicon: Fix potential use-after-free in hix5hd2_rx()

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

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

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

net: hisilicon: Fix potential use-after-free in hix5hd2_rx()

The skb is delivered to napi_gro_receive() which may free it, after
calling this, dereferencing skb may trigger use-after-free.

The Linux kernel CVE team has assigned CVE-2022-48960 to this issue.

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

	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 4.9.336 with commit 179499e7a240
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 4.14.302 with commit 8067cd244cea
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 4.19.269 with commit 3a4eddd1cb02
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 5.4.227 with commit 1b6360a093ab
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 5.10.159 with commit 93aaa4bb72e3
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 5.15.83 with commit b8ce0e6f9f88
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 6.0.13 with commit b6307f7a2fc1
	Issue introduced in 3.16 with commit 57c5bc9ad7d7 and fixed in 6.1 with commit 433c07a13f59

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-2022-48960
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/hisilicon/hix5hd2_gmac.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/179499e7a240b2ef590f05eb379c810c26bbc8a4
	https://git.kernel.org/stable/c/8067cd244cea2c332f8326842fd10158fa2cb64f
	https://git.kernel.org/stable/c/3a4eddd1cb023a71df4152fcc76092953e6fe95a
	https://git.kernel.org/stable/c/1b6360a093ab8969c91a30bb58b753282e2ced4c
	https://git.kernel.org/stable/c/93aaa4bb72e388f6a4887541fd3d18b84f1b5ddc
	https://git.kernel.org/stable/c/b8ce0e6f9f88a6bb49d291498377e61ea27a5387
	https://git.kernel.org/stable/c/b6307f7a2fc1c5407b6176f2af34a95214a8c262
	https://git.kernel.org/stable/c/433c07a13f59856e4585e89e86b7d4cc59348fab