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 9F6293191A7 for ; Fri, 5 Sep 2025 17:27:32 +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=1757093252; cv=none; b=Mwe51de7dYyYTh1Ivz7EOh7MZjMh/iQsn52R8d+NUBXM6NWhobU8qHplABmcuuQuoeu3aFbSt6FOLZC3lGbI8p0OauqeigoDoS/i+CB7aJ0TOpGXBvYVr3PqnagW7C3by6KOhGkFvJszRGxbcWYjQw/99SCmiDPuWrG7Y2sx1Zw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757093252; c=relaxed/simple; bh=brIisrPODsY8PVhORlMBUA8/ApIk50SPiL4zmNT1tfg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qg4RGy4Ab26r5ihpCXvsShs+tV3FTvW/kq+EB5lJC7EeTE9qcS7cNjZ0+dsPOiGM/6uWBcGOTHkuEEyhMjj6Cxh1i3hlWXe27a7M7QRQahe5iU1NG/YaEp8fLvpt2IMyZft5stmYZpPCu42bQkovDMF14fJnjrw4iyi9Q8H6LKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uEhmmU/3; 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="uEhmmU/3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A875CC4CEF1; Fri, 5 Sep 2025 17:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757093252; bh=brIisrPODsY8PVhORlMBUA8/ApIk50SPiL4zmNT1tfg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uEhmmU/3wWUZEE3eXVyxZBrYpkp3DpIaOZxdCCUL9YfZx1jGyp8Wdn7WyjFYmeF6o qR2VZ/CYRFLxpHP33GcqbHJ3vlcgvLOuy9R2MfMvGLH7He/p3WUUlZxiYE5yjVPWhN 3FDnyVRjFvMPUfs2FBbk4DIT3xX4xKKSVLzyD/NI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39725: mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list Date: Fri, 5 Sep 2025 19:27:23 +0200 Message-ID: <2025090522-CVE-2025-39725-7881@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=3086; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UHMRxpcvfIr4IKsy+Bnv6rm9jpRQ+pxuWvLfFQ9R1tY=; b=owGbwMvMwCRo6H6F97bub03G02pJDBm7Zatqn/o+fm34a47qjFdTZh5YdOXkG9fvuziO/D/7Q fdcQdv2Gx2xLAyCTAyyYoosX7bxHN1fcUjRy9D2NMwcViaQIQxcnAIwkdcWDAsmzZFh6Zi+0exx 2tHvtnu+qcubz37BML/89vbuvd36p8tuCdtHPZvzx5BdfTcA 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: mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list In shrink_folio_list(), the hwpoisoned folio may be large folio, which can't be handled by unmap_poisoned_folio(). For THP, try_to_unmap_one() must be passed with TTU_SPLIT_HUGE_PMD to split huge PMD first and then retry. Without TTU_SPLIT_HUGE_PMD, we will trigger null-ptr deref of pvmw.pte. Even we passed TTU_SPLIT_HUGE_PMD, we will trigger a WARN_ON_ONCE due to the page isn't in swapcache. Since UCE is rare in real world, and race with reclaimation is more rare, just skipping the hwpoisoned large folio is enough. memory_failure() will handle it if the UCE is triggered again. This happens when memory reclaim for large folio races with memory_failure(), and will lead to kernel panic. The race is as follows: cpu0 cpu1 shrink_folio_list memory_failure TestSetPageHWPoison unmap_poisoned_folio --> trigger BUG_ON due to unmap_poisoned_folio couldn't handle large folio [tujinjiang@huawei.com: add comment to unmap_poisoned_folio()] The Linux kernel CVE team has assigned CVE-2025-39725 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12.26 with commit 1c9798bf8145a92abf45aa9d38a6406d9eb8bdf0 and fixed in 6.12.41 with commit 656eaddbc952e1baae2f69281c22debe22140312 Issue introduced in 6.15 with commit 1b0449544c6482179ac84530b61fc192a6527bfd and fixed in 6.15.9 with commit c1101113d45838a823188ae25c61af97552a28ae Issue introduced in 6.15 with commit 1b0449544c6482179ac84530b61fc192a6527bfd and fixed in 6.16 with commit 9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab Issue introduced in 6.14.5 with commit 912e9f0300c3564b72a8808db406e313193a37ad 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-39725 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: mm/memory-failure.c mm/vmscan.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/656eaddbc952e1baae2f69281c22debe22140312 https://git.kernel.org/stable/c/c1101113d45838a823188ae25c61af97552a28ae https://git.kernel.org/stable/c/9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab