{"id":"CVE-2026-31576","published":"2026-04-24T14:42:08Z","modified":"2026-06-14T17:42:00Z","title":"media: hackrf: fix to not free memory after the device is registered in hackrf_probe()","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: hackrf: fix to not free memory after the device is registered in hackrf_probe()\n\nIn hackrf driver, the following race condition occurs:\n```\n\t\tCPU0\t\t\t\t\t\tCPU1\nhackrf_probe()\n  kzalloc(); // alloc hackrf_dev\n  ....\n  v4l2_device_register();\n  ....\n\t\t\t\t\t\tfd = sys_open(\"/path/to/dev\"); // open hackrf fd\n\t\t\t\t\t\t....\n  v4l2_device_unregister();\n  ....\n  kfree(); // free hackrf_dev\n  ....\n\t\t\t\t\t\tsys_ioctl(fd, ...);\n\t\t\t\t\t\t  v4l2_ioctl();\n\t\t\t\t\t\t    video_is_registered() // UAF!!\n\t\t\t\t\t\t....\n\t\t\t\t\t\tsys_close(fd);\n\t\t\t\t\t\t  v4l2_release() // UAF!!\n\t\t\t\t\t\t    hackrf_video_release()\n\t\t\t\t\t\t      kfree(); // DFB!!\n```\n\nWhen a V4L2 or video device is unregistered, the device node is removed so\nnew open() calls are blocked.\n\nHowever, file descriptors that are already open-and any in-flight I/O-do\nnot terminate immediately; they remain valid until the last reference is\ndropped and the driver's release() is invoked.\n\nTherefore, freeing device memory on the error path after hackrf_probe()\nhas registered dev it will lead to a race to use-after-free vuln, since\nthose already-open handles haven't been released yet.\n\nAnd since release() free memory too, race to use-after-free and\ndouble-free vuln occur.\n\nTo prevent this, if device is registered from probe(), it should be\nmodified to free memory only through release() rather than calling\nkfree() directly.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.00181,"percentile":0.04503,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/87b9685cca91ed715c39ba544715832d26a7f4b4","tags":[]},{"url":"https://git.kernel.org/stable/c/131ec9046e1c8af101aebdaec4e8095e05f3312b","tags":[]},{"url":"https://git.kernel.org/stable/c/67fd62e3efdc9dce01f76d95a745212f4feb38e6","tags":[]},{"url":"https://git.kernel.org/stable/c/45cbaf5c7cdc5386d86377f0daf94a17a007fed0","tags":[]},{"url":"https://git.kernel.org/stable/c/98a0a81ce78020c2522e0046f49d200de9778cb9","tags":[]},{"url":"https://git.kernel.org/stable/c/07e9e674b6146b1f6fc41b1f54b8968bf2802824","tags":[]},{"url":"https://git.kernel.org/stable/c/2145c71a8044362e82e9923f001ba2aeb771b848","tags":[]},{"url":"https://git.kernel.org/stable/c/fcd1d70792a35c8a97414fe429f48311e41269c2","tags":[]},{"url":"https://git.kernel.org/stable/c/3b7da2b4d0fe014eff181ed37e3bf832eb8ed258","tags":[]}],"priority":{"score":0.9,"factors":[{"name":"EPSS percentile","points":0.9}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 87b9685cca91ed715c39ba544715832d26a7f4b4",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 131ec9046e1c8af101aebdaec4e8095e05f3312b",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 67fd62e3efdc9dce01f76d95a745212f4feb38e6",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 45cbaf5c7cdc5386d86377f0daf94a17a007fed0",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 98a0a81ce78020c2522e0046f49d200de9778cb9",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 07e9e674b6146b1f6fc41b1f54b8968bf2802824",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 2145c71a8044362e82e9923f001ba2aeb771b848",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < fcd1d70792a35c8a97414fe429f48311e41269c2",">= 8bc4a9ed85046c214458c9e82aea75d2f46cfffd, < 3b7da2b4d0fe014eff181ed37e3bf832eb8ed258"]},{"vendor":"Linux","product":"Linux","versions":["4.4"]}],"euvd":{"id":"EUVD-2026-25469","exploited":false,"provenance":"source"}}