Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99F053D410E for ; Fri, 24 Apr 2026 14:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041845; cv=none; b=oVG/RYHKIg5GLhc9aC/4ymX9Uwyzdd3kQ4Tw3sd5hutptDfp0ualMQg7/XpPF2Q/Txe6izTzG+YyPj9q6nj0DDLOykke0q/ZDtoYKaY7ZlRaKa5QXzR2n5KDmNHt37vhQYTwOfe3Nj2auCuo+J+GImKSICmz+b8HNygIPZ4TFaE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041845; c=relaxed/simple; bh=kaiNd7KjcwjS2nP9eQ3G1onj9pgit/tkFPxB5b0p9sY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tJkwH9W9ZbbFfMfSIw1uJDo0SEvU4i4wrLkG3ZEBDK0SYF8CS/k/+wiGXgx5bxCsDsVjAZZoGhCmJOu3bXGnhMvSV65pqlrD9iGFSnZO3+mUHKNpP/OwgYPKLqZP+sKGMpXDkHnIgu+GknSPRJ2XAFfzXJrl0BLTTu12Z3A3ZQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CWlYVPmR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CWlYVPmR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3174EC19425; Fri, 24 Apr 2026 14:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041845; bh=kaiNd7KjcwjS2nP9eQ3G1onj9pgit/tkFPxB5b0p9sY=; h=From:To:Cc:Subject:Date:Reply-To:From; b=CWlYVPmRr7DnNkM4erI2j42VL3euit2+g9mgZkwOCRKlTB5gt62h36mKKjqTGbkg1 0ZUlr49tG81Ap3Q71hHcORuiv3amkUepzG1W6GO/wJDcjlbsS8DEuG9KDlqKrg8aIF 3oUbX1B/QsWpIcfr1ZtGsTtmk6s6+MRSjY0bcks8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31576: media: hackrf: fix to not free memory after the device is registered in hackrf_probe() Date: Fri, 24 Apr 2026 16:43:12 +0200 Message-ID: <2026042410-CVE-2026-31576-e770@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3313; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=918qhwF3doAAF0wfg/oOMRAueNAdpLWcWJVhTcK/RMI=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvG+sei3JGLxD+9O1KwpvsZYxlicqCIjMbe6zvBVott v0S99KhI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSocGwYOtcQdMquWdSa19L t66WNFs1VScjnWF+ndrdCreNu+WXZkyd9zHvQuJcj7YMAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: media: hackrf: fix to not free memory after the device is registered in hackrf_probe() In hackrf driver, the following race condition occurs: ``` CPU0 CPU1 hackrf_probe() kzalloc(); // alloc hackrf_dev .... v4l2_device_register(); .... fd = sys_open("/path/to/dev"); // open hackrf fd .... v4l2_device_unregister(); .... kfree(); // free hackrf_dev .... sys_ioctl(fd, ...); v4l2_ioctl(); video_is_registered() // UAF!! .... sys_close(fd); v4l2_release() // UAF!! hackrf_video_release() 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 hackrf_probe() 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. The Linux kernel CVE team has assigned CVE-2026-31576 to this issue. Affected and fixed versions =========================== Fixed in 6.12.83 with commit 98a0a81ce78020c2522e0046f49d200de9778cb9 Fixed in 6.18.24 with commit 07e9e674b6146b1f6fc41b1f54b8968bf2802824 Fixed in 6.19.14 with commit 2145c71a8044362e82e9923f001ba2aeb771b848 Fixed in 7.0.1 with commit fcd1d70792a35c8a97414fe429f48311e41269c2 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-31576 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/98a0a81ce78020c2522e0046f49d200de9778cb9 https://git.kernel.org/stable/c/07e9e674b6146b1f6fc41b1f54b8968bf2802824 https://git.kernel.org/stable/c/2145c71a8044362e82e9923f001ba2aeb771b848 https://git.kernel.org/stable/c/fcd1d70792a35c8a97414fe429f48311e41269c2 https://git.kernel.org/stable/c/3b7da2b4d0fe014eff181ed37e3bf832eb8ed258