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 639233191DA for ; Fri, 5 Sep 2025 17:24:46 +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=1757093086; cv=none; b=lyj+Xup5/mj/RBzsMYRPcREqpqVSMMpE0EA/xoVVUOSzmEOhpkI08fDNWiVUWEqUh4/Iw6mYCGLfa050mQgj0MJwizQRjHYqypUXTjhyqUfsL2xdywIJ5vYQRGWFIrbMxbP+Jded2H/QNhMbSyt9wj3s3owxwhwYBVYwxWG4IO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757093086; c=relaxed/simple; bh=45cRO6BAGda9KHrtT5dDAmTeb8qwXkYhI4GlF7oQYJU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JBju7phkbgXlH+p0qv6KFL96++OTtv4NJMIlOG9m3DF64kEJpJyxORyfHNaawoa0Gd34mvC5XapI3hv8LwfpeJVYnAI9NT5NxdQJmiG/K2QrtNgPUDtY7BM3j0YXod7lx4lUXC148vVgLsA/pUIHZdqF0H9E0JHXkozsw3Dw6R4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cZRDP9u8; 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="cZRDP9u8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A353C4CEF1; Fri, 5 Sep 2025 17:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757093086; bh=45cRO6BAGda9KHrtT5dDAmTeb8qwXkYhI4GlF7oQYJU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cZRDP9u8t0RUvUfaMAAqnzuiEkrsvtBZwz7mBO6hQ/O0/1b78B8nw42R11PKTdS3V DRnNFVPy3+E0iXiUuD5PnQ99PLh0sbn2PWlv502IXmxQHLM0K4RSBFyUoPMNPTSb7W z/ZWAhxKxNfe3P89Ly9tb6flnD/94+juE/58YcFo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39711: media: ivsc: Fix crash at shutdown due to missing mei_cldev_disable() calls Date: Fri, 5 Sep 2025 19:21:24 +0200 Message-ID: <2025090550-CVE-2025-39711-5512@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4220; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hMzkG5sV+aps5fy4q5EkrUJMjr/jeOPowbdWmYvdX2A=; b=owGbwMvMwCRo6H6F97bub03G02pJDBm7pT85J3+KZ5vWd+9QYu/9d2laN5Yb3Gzl35fjdNTT5 TDzOdHGjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAYTJDAs6Lz3M1Vw5k/HNxptB LJM7N+ddKtvDMD87M6K/OjD89Nqlpn/s+O5sCH2SFAcA 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: ivsc: Fix crash at shutdown due to missing mei_cldev_disable() calls Both the ACE and CSI driver are missing a mei_cldev_disable() call in their remove() function. This causes the mei_cl client to stay part of the mei_device->file_list list even though its memory is freed by mei_cl_bus_dev_release() calling kfree(cldev->cl). This leads to a use-after-free when mei_vsc_remove() runs mei_stop() which first removes all mei bus devices calling mei_ace_remove() and mei_csi_remove() followed by mei_cl_bus_dev_release() and then calls mei_cl_all_disconnect() which walks over mei_device->file_list dereferecing the just freed cldev->cl. And mei_vsc_remove() it self is run at shutdown because of the platform_device_unregister(tp->pdev) in vsc_tp_shutdown() When building a kernel with KASAN this leads to the following KASAN report: [ 106.634504] ================================================================== [ 106.634623] BUG: KASAN: slab-use-after-free in mei_cl_set_disconnected (drivers/misc/mei/client.c:783) mei [ 106.634683] Read of size 4 at addr ffff88819cb62018 by task systemd-shutdow/1 [ 106.634729] [ 106.634767] Tainted: [E]=UNSIGNED_MODULE [ 106.634770] Hardware name: Dell Inc. XPS 16 9640/09CK4V, BIOS 1.12.0 02/10/2025 [ 106.634773] Call Trace: [ 106.634777] ... [ 106.634871] kasan_report (mm/kasan/report.c:221 mm/kasan/report.c:636) [ 106.634901] mei_cl_set_disconnected (drivers/misc/mei/client.c:783) mei [ 106.634921] mei_cl_all_disconnect (drivers/misc/mei/client.c:2165 (discriminator 4)) mei [ 106.634941] mei_reset (drivers/misc/mei/init.c:163) mei ... [ 106.635042] mei_stop (drivers/misc/mei/init.c:348) mei [ 106.635062] mei_vsc_remove (drivers/misc/mei/mei_dev.h:784 drivers/misc/mei/platform-vsc.c:393) mei_vsc [ 106.635066] platform_remove (drivers/base/platform.c:1424) Add the missing mei_cldev_disable() calls so that the mei_cl gets removed from mei_device->file_list before it is freed to fix this. The Linux kernel CVE team has assigned CVE-2025-39711 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit 29006e196a5661d9afc8152fa2bf8a5347ac17b4 and fixed in 6.6.103 with commit 3c0e4cc4f55f9a1db2a761e4ffb27c9594245888 Issue introduced in 6.6 with commit 29006e196a5661d9afc8152fa2bf8a5347ac17b4 and fixed in 6.12.44 with commit 639f5b33fcd7c59157f29b09f6f2866eacf9279c Issue introduced in 6.6 with commit 29006e196a5661d9afc8152fa2bf8a5347ac17b4 and fixed in 6.16.4 with commit 1dfe73394dcfc9b049c8da0dc181c45f156a5f49 Issue introduced in 6.6 with commit 29006e196a5661d9afc8152fa2bf8a5347ac17b4 and fixed in 6.17-rc1 with commit 0c92c49fc688cfadacc47ae99b06a31237702e9e 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-2025-39711 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/pci/intel/ivsc/mei_ace.c drivers/media/pci/intel/ivsc/mei_csi.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/3c0e4cc4f55f9a1db2a761e4ffb27c9594245888 https://git.kernel.org/stable/c/639f5b33fcd7c59157f29b09f6f2866eacf9279c https://git.kernel.org/stable/c/1dfe73394dcfc9b049c8da0dc181c45f156a5f49 https://git.kernel.org/stable/c/0c92c49fc688cfadacc47ae99b06a31237702e9e