CVE-2026-31576: media: hackrf: fix to not free memory after the device is registered in hackrf_probe()

Published Apr 24, 2026
·
Updated

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

media: hackrf: fix to not free memory after the device is registered in hackrfprobe()

In hackrf driver, the following race condition occurs: CPU0 CPU1 hackrfprobe() kzalloc(); // alloc hackrfdev .... v4l2deviceregister(); .... fd = sysopen("/path/to/dev"); // open hackrf fd .... v4l2deviceunregister(); .... kfree(); // free hackrfdev .... sysioctl(fd, ...); v4l2ioctl(); videoisregistered() // UAF!! .... sysclose(fd); v4l2release() // UAF!! hackrfvideorelease() kfree(); // DFB!!

When a V4L2 or video device is unregistered, the device node is removed so new open() calls are blocked.

However, file descriptors that are already open-and any in-flight I/O-do not terminate immediately; they remain valid until the last reference is dropped and the driver's release() is invoked.

Therefore, freeing device memory on the error path after hackrfprobe() has registered dev it will lead to a race to use-after-free vuln, since those already-open handles haven't been released yet.

And since release() free memory too, race to use-after-free and double-free vuln occur.

To prevent this, if device is registered from probe(), it should be modified to free memory only through release() rather than calling kfree() directly.

Affected Software

7 affected componentsFixes available
Linux Linux kernel (hackrf driver)
Linux Linux kernel<6.6.136
Linux Linux kernel>=6.7<6.12.83
Linux Linux kernel>=6.13<6.18.24
Linux Linux kernel>=6.19<6.19.14
Linux Linux kernel>=7.0<7.0.1
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
  2. Compensating control

    In the Linux kernel hackrf driver, when the device has been registered from hackrf_probe(), free the device memory only through release() rather than calling kfree() directly on the error path.

Event History

Apr 24, 2026
CVE Published
via MITRE·02:42 PM
Data Sourced
via MITRE·02:42 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2026-31576?

CVE-2026-31576 is classified as a moderate severity vulnerability due to a race condition affecting memory management in the hackrf driver.

2

How do I fix CVE-2026-31576?

To fix CVE-2026-31576, update the Linux kernel to a version that includes the patch for the hackrf driver.

3

What systems are affected by CVE-2026-31576?

CVE-2026-31576 affects various versions of the Linux kernel, particularly those utilizing the hackrf driver.

4

What causes CVE-2026-31576?

CVE-2026-31576 is caused by a race condition that occurs when the hackrf device memory is improperly managed after registration.

5

Is CVE-2026-31576 exploitable remotely?

CVE-2026-31576 may not be directly exploitable remotely, but it can lead to system instability, making it a risk in certain environments.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203