Skip to contentSkip to conversation

CVE-2024-40937: gve: Clear napi->skb before dev_kfree_skb_any()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore
#0 lore raw

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

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

gve: Clear napi->skb before dev_kfree_skb_any()

gve_rx_free_skb incorrectly leaves napi->skb referencing an skb after it is freed with dev_kfree_skb_any(). This can result in a subsequent call to napi_get_frags returning a dangling pointer.

Fix this by clearing napi->skb before the skb is freed.

The Linux kernel CVE team has assigned CVE-2024-40937 to this issue.

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

	Issue introduced in 5.14 with commit 9b8dd5e5ea48 and fixed in 5.15.162 with commit 75afd8724739
	Issue introduced in 5.14 with commit 9b8dd5e5ea48 and fixed in 6.1.95 with commit d22128499111
	Issue introduced in 5.14 with commit 9b8dd5e5ea48 and fixed in 6.6.35 with commit 2ce5341c3699
	Issue introduced in 5.14 with commit 9b8dd5e5ea48 and fixed in 6.9.6 with commit a68184d5b420
	Issue introduced in 5.14 with commit 9b8dd5e5ea48 and fixed in 6.10-rc4 with commit 6f4d93b78ade

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-2024-40937

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/google/gve/gve_rx_dqo.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/75afd8724739ee5ed8165acde5f6ac3988b485cc
	https://git.kernel.org/stable/c/d221284991118c0ab16480b53baecd857c0bc442
	https://git.kernel.org/stable/c/2ce5341c36993b776012601921d7688693f8c037
	https://git.kernel.org/stable/c/a68184d5b420ea4fc7e6b7ceb52bbc66f90d3c50
	https://git.kernel.org/stable/c/6f4d93b78ade0a4c2cafd587f7b429ce95abb02e