Skip to contentSkip to conversation

CVE-2022-49619: net: sfp: fix memory leak in sfp_probe()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

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

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

net: sfp: fix memory leak in sfp_probe()

sfp_probe() allocates a memory chunk from sfp with sfp_alloc(). When devm_add_action() fails, sfp is not freed, which leads to a memory leak.

We should use devm_add_action_or_reset() instead of devm_add_action().

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

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

	Fixed in 4.14.289 with commit 9ec5a97f327a89031fce6cfc3e95543c53936638
	Fixed in 4.19.253 with commit 1545bc727625ea6e8decd717e5d1e8cc704ccf8f
	Fixed in 5.4.207 with commit ede990cfc42775bd0141e21f37ee365dcaeeb50f
	Fixed in 5.10.132 with commit 67dc32542a1fb7790d0853cf4a5cf859ac6a2002
	Fixed in 5.15.56 with commit 204543581a2f26bb3b997a304c0bd06926ba7f15
	Fixed in 5.18.13 with commit f22ddc8a5278d7fb6369a0aeb0d8775a0aefaaee
	Fixed in 5.19 with commit 0a18d802d65cf662644fd1d369c86d84a5630652

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-49619

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/phy/sfp.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/9ec5a97f327a89031fce6cfc3e95543c53936638
	https://git.kernel.org/stable/c/1545bc727625ea6e8decd717e5d1e8cc704ccf8f
	https://git.kernel.org/stable/c/ede990cfc42775bd0141e21f37ee365dcaeeb50f
	https://git.kernel.org/stable/c/67dc32542a1fb7790d0853cf4a5cf859ac6a2002
	https://git.kernel.org/stable/c/204543581a2f26bb3b997a304c0bd06926ba7f15
	https://git.kernel.org/stable/c/f22ddc8a5278d7fb6369a0aeb0d8775a0aefaaee
	https://git.kernel.org/stable/c/0a18d802d65cf662644fd1d369c86d84a5630652