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 6802A3DDDB8 for ; Fri, 24 Apr 2026 14:44:13 +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=1777041853; cv=none; b=bYxDJs+v2vswdD/H5d364ljpmR0/dooxk6Sc5LyFvJzmQji/NxALXhVbtgSKYb/B33KFDl+hFzD4BM/AqSy0MFMjyXZl+9qqNCAcIW9SL4xEzSYVaeVja2hhEhNBXH9Rfw1vVTtpOM5XFdGayrpslDG4j1r/WCWd6Aew/gJ5bBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041853; c=relaxed/simple; bh=ENAL74w1/SyXuXkxSjor28N7X7lzu3G++tbPqCaWgo4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lWlPwbf8EYtS3rX4idBLfImkFex+YUfp7+kYBCVrUlz52zOkk8zCADD7ek8RsTljlO4w6h4LCdDDYioR17QgfA4j+4sLDwPGj0UQn89ARV/a2I8CMBRD/BFE8aPehBlmc+LusqQQnHGcWp2u9zfY55rKyHNjBxNVmgz15JI9zGI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N8mETkFi; 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="N8mETkFi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F15B6C19425; Fri, 24 Apr 2026 14:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041853; bh=ENAL74w1/SyXuXkxSjor28N7X7lzu3G++tbPqCaWgo4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=N8mETkFib/qvdpmL2vIE7tuLRBChyyGUOnfB0agJrnHTwJsEj1R+R1dzFCt9RuzGZ po96tKmjwnOJ8Pqo/VK7GUwSot2za080L9rU+S2TEX+KTgKsLjrYg8vNmdENL2SjVy XXyZ08trkk4ysGnD5k2lYWzbsEMMlizYqr5XEQh8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31578: media: as102: fix to not free memory after the device is registered in as102_usb_probe() Date: Fri, 24 Apr 2026 16:43:14 +0200 Message-ID: <2026042410-CVE-2026-31578-fd48@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=3417; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LQSJCXlFgH6Ir4fALSF9LwvxWJJZTJA/0AK7y86QWI0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvG+vu25usnyW36DLDqiveVtKH5novKTn44Ebnimeu3 /hrz5pM7YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJTHVlmKc50yB+wZ4qa82l MTLfj9aUrF3+wJphwdGP+ZO+lp2oFb/WsM/lxcSrqawMFwA= 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: as102: fix to not free memory after the device is registered in as102_usb_probe() In as102_usb driver, the following race condition occurs: ``` CPU0 CPU1 as102_usb_probe() kzalloc(); // alloc as102_dev_t .... usb_register_dev(); fd = sys_open("/path/to/dev"); // open as102 fd .... usb_deregister_dev(); .... kfree(); // free as102_dev_t .... sys_close(fd); as102_release() // UAF!! as102_usb_release() kfree(); // DFB!! ``` When a USB character device registered with usb_register_dev() is later unregistered (via usb_deregister_dev() or disconnect), the device node is removed so new open() calls fail. However, file descriptors that are already open do not go away immediately: they remain valid until the last reference is dropped and the driver's .release() is invoked. In as102, as102_usb_probe() calls usb_register_dev() and then, on an error path, does usb_deregister_dev() and frees as102_dev_t right away. If userspace raced a successful open() before the deregistration, that open FD will later hit as102_release() --> as102_usb_release() and access or free as102_dev_t again, occur a race to use-after-free and double-free vuln. The fix is to never kfree(as102_dev_t) directly once usb_register_dev() has succeeded. After deregistration, defer freeing memory to .release(). In other words, let release() perform the last kfree when the final open FD is closed. The Linux kernel CVE team has assigned CVE-2026-31578 to this issue. Affected and fixed versions =========================== Fixed in 6.12.83 with commit 582fbecb3756330006fe1950762412a68c2cacd2 Fixed in 6.18.24 with commit 09e9206008b887aa553733bd915d73131071a086 Fixed in 6.19.14 with commit 2eeae47a438694408189138048a786be99954032 Fixed in 7.0.1 with commit 7e5aedf6059cba2a669d86caeaf5a51f33ec85a1 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-31578 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/as102/as102_usb_drv.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/582fbecb3756330006fe1950762412a68c2cacd2 https://git.kernel.org/stable/c/09e9206008b887aa553733bd915d73131071a086 https://git.kernel.org/stable/c/2eeae47a438694408189138048a786be99954032 https://git.kernel.org/stable/c/7e5aedf6059cba2a669d86caeaf5a51f33ec85a1 https://git.kernel.org/stable/c/8bd29dbe03fc5b0f039ab2395ff37b64236d2f0c