CVE-2026-31576
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
24/04/2026
Last modified:
27/04/2026
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
media: hackrf: fix to not free memory after the device is registered in hackrf_probe()<br />
<br />
In hackrf driver, the following race condition occurs:<br />
```<br />
CPU0 CPU1<br />
hackrf_probe()<br />
kzalloc(); // alloc hackrf_dev<br />
....<br />
v4l2_device_register();<br />
....<br />
fd = sys_open("/path/to/dev"); // open hackrf fd<br />
....<br />
v4l2_device_unregister();<br />
....<br />
kfree(); // free hackrf_dev<br />
....<br />
sys_ioctl(fd, ...);<br />
v4l2_ioctl();<br />
video_is_registered() // UAF!!<br />
....<br />
sys_close(fd);<br />
v4l2_release() // UAF!!<br />
hackrf_video_release()<br />
kfree(); // DFB!!<br />
```<br />
<br />
When a V4L2 or video device is unregistered, the device node is removed so<br />
new open() calls are blocked.<br />
<br />
However, file descriptors that are already open-and any in-flight I/O-do<br />
not terminate immediately; they remain valid until the last reference is<br />
dropped and the driver&#39;s release() is invoked.<br />
<br />
Therefore, freeing device memory on the error path after hackrf_probe()<br />
has registered dev it will lead to a race to use-after-free vuln, since<br />
those already-open handles haven&#39;t been released yet.<br />
<br />
And since release() free memory too, race to use-after-free and<br />
double-free vuln occur.<br />
<br />
To prevent this, if device is registered from probe(), it should be<br />
modified to free memory only through release() rather than calling<br />
kfree() directly.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.6.136 (excluding) | |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.83 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.18.24 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.19 (including) | 6.19.14 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 7.0 (including) | 7.0.1 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/07e9e674b6146b1f6fc41b1f54b8968bf2802824
- https://git.kernel.org/stable/c/2145c71a8044362e82e9923f001ba2aeb771b848
- https://git.kernel.org/stable/c/3b7da2b4d0fe014eff181ed37e3bf832eb8ed258
- https://git.kernel.org/stable/c/45cbaf5c7cdc5386d86377f0daf94a17a007fed0
- https://git.kernel.org/stable/c/98a0a81ce78020c2522e0046f49d200de9778cb9
- https://git.kernel.org/stable/c/fcd1d70792a35c8a97414fe429f48311e41269c2



