Skip to contentSkip to conversation

CVE-2024-53213: net: usb: lan78xx: Fix double free issue with interrupt buffer allocation

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 27, 2024

lore
Share & tools
lore
#0 lore raw

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

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

net: usb: lan78xx: Fix double free issue with interrupt buffer allocation

In lan78xx_probe(), the buffer buf was being freed twice: once implicitly through usb_free_urb(dev->urb_intr) with the URB_FREE_BUFFER flag and again explicitly by kfree(buf). This caused a double free issue.

To resolve this, reordered kmalloc() and usb_alloc_urb() calls to simplify the initialization sequence and removed the redundant kfree(buf). Now, buf is allocated after usb_alloc_urb(), ensuring it is correctly managed by usb_fill_int_urb() and freed by usb_free_urb() as intended.

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

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

	Issue introduced in 5.17 with commit a6df95cae40bee555e01a37b4023ce8e97ffa249 and fixed in 6.1.120 with commit 977128343fc2a30737399b58df8ea77e94f164bd
	Issue introduced in 5.17 with commit a6df95cae40bee555e01a37b4023ce8e97ffa249 and fixed in 6.6.64 with commit a422ebec863d99d5607fb41bb7af3347fcb436d3
	Issue introduced in 5.17 with commit a6df95cae40bee555e01a37b4023ce8e97ffa249 and fixed in 6.11.11 with commit b09512aea6223eec756f52aa584fc29eeab57480
	Issue introduced in 5.17 with commit a6df95cae40bee555e01a37b4023ce8e97ffa249 and fixed in 6.12.2 with commit 7ac9f3c981eeceee2ec4d30d850f4a6f50a1ec40
	Issue introduced in 5.17 with commit a6df95cae40bee555e01a37b4023ce8e97ffa249 and fixed in 6.13-rc1 with commit 03819abbeb11117dcbba40bfe322b88c0c88a6b6

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

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/usb/lan78xx.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/977128343fc2a30737399b58df8ea77e94f164bd
	https://git.kernel.org/stable/c/a422ebec863d99d5607fb41bb7af3347fcb436d3
	https://git.kernel.org/stable/c/b09512aea6223eec756f52aa584fc29eeab57480
	https://git.kernel.org/stable/c/7ac9f3c981eeceee2ec4d30d850f4a6f50a1ec40
	https://git.kernel.org/stable/c/03819abbeb11117dcbba40bfe322b88c0c88a6b6