CVE-2026-99510: media: hackrf: fix use-after-free in hackrf_alloc_urbs() error path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: hackrf: fix use-after-free in hackrf_alloc_urbs() error path
hackrf_alloc_urbs() frees the URBs it allocated so far when one allocation fails, but leaves the entries in dev->urb_list[] and dev->urbs_initialized untouched. The caller, hackrf_start_streaming(), then calls hackrf_free_urbs() on the error path, which walks dev->urbs_initialized entries and calls usb_free_urb() a second time on the already-freed URBs, causing a use-after-free (slab-use-after-free Write in usb_free_urb()).
Drop the redundant cleanup loop inside hackrf_alloc_urbs() and let hackrf_free_urbs(), which the caller already invokes on error, own the cleanup of the successfully allocated URBs.
The Linux kernel CVE team has assigned CVE-2026-99510 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.18 with commit 969ec1f6bd925092109eaf21501a9d64adfc7ad4 and fixed in 6.12.117 with commit ed8d9b2015afd540f6159ed272702a87f02fbd05 Issue introduced in 3.18 with commit 969ec1f6bd925092109eaf21501a9d64adfc7ad4 and fixed in 6.18.61 with commit e9deece85062873763dfbb8b1121e722ef2959a0 Issue introduced in 3.18 with commit 969ec1f6bd925092109eaf21501a9d64adfc7ad4 and fixed in 7.3.2 with commit ba097d24c56bc3c57a1173506c3c5a42d0f94988 Issue introduced in 3.18 with commit 969ec1f6bd925092109eaf21501a9d64adfc7ad4 and fixed in 7.4-rc1 with commit 6802ad4b6b267dda02209b5811edac7825c8a5f6
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-2026-99510
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/media/usb/hackrf/hackrf.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/ed8d9b2015afd540f6159ed272702a87f02fbd05 https://git.kernel.org/stable/c/e9deece85062873763dfbb8b1121e722ef2959a0 https://git.kernel.org/stable/c/ba097d24c56bc3c57a1173506c3c5a42d0f94988 https://git.kernel.org/stable/c/6802ad4b6b267dda02209b5811edac7825c8a5f6