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 E58F42EE276 for ; Fri, 25 Jul 2025 15:28:42 +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=1753457323; cv=none; b=GHZEQkLQ4QiJ5F1y28mJ3TktgTjTOyDXa/SJkxbzSbr16U69YirM808ON64sfzouGcWAThqWtrrcqnKDcVL5K06OFcnctxu/g/9KPNDHZZv7NIppt6xfPFkGhIhkokbkZXgJB/XQX+Nu8ZWOsDL45XUTSGbN9OclaJ2DnE+Fc18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753457323; c=relaxed/simple; bh=OsS9dvfelBK7pkwXkKLUpgc+HwBwbu5Py4RSvTR3v+A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TVrdE1fDwN4myKnlYEniBvAsjbN3g/hktuYFwDp10bcBnn3evUH63CdTGF3SoYx1yl7TwbR/Y0/q9IxBTC7MemnK0uiVZq/YJCo34/18XT9t3klbh+jaUoLS64uTS1SzuWyri7s5lRnRwG+dUOMC/9eXxUOphbwaWr+B4kXu718= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sVK8r5nL; 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="sVK8r5nL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4605BC4CEE7; Fri, 25 Jul 2025 15:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753457322; bh=OsS9dvfelBK7pkwXkKLUpgc+HwBwbu5Py4RSvTR3v+A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sVK8r5nLiYRM8MPolGWFF7hBc6R0HRo23YJXLr5PWeyZG8pV+JnY5FcGGyx2DPOia onWM+1m0dPYTpgv71dfVwqkiga6j8oEEEoHKRbrZX67IwuyQCmhaR8+oIXAsK7aNs0 lB3xSyvEqQ2Nv9xyRI3PS2/Ek2xqmQFU+O26zJkk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38447: mm/rmap: fix potential out-of-bounds page table access during batched unmap Date: Fri, 25 Jul 2025 17:28:09 +0200 Message-ID: <2025072503-CVE-2025-38447-5233@gregkh> X-Mailer: git-send-email 2.50.1 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=2520; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=OnMSrcsEJxF8PTtEJ99wdWxS2RlQE1HdLyoN7JvE1NA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNi5o3b24o9pocHRHQvLeu49Xnp8en8CcJt/Wn6pw/x PzrofD8jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI42GGuZKm0kf/HJjkwatr 2pDxyXrWV5aZ0gzzi2Tt93AufLFqjrW5p7BW4aoH7l9mAQA= 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/rmap: fix potential out-of-bounds page table access during batched unmap As pointed out by David[1], the batched unmap logic in try_to_unmap_one() may read past the end of a PTE table when a large folio's PTE mappings are not fully contained within a single page table. While this scenario might be rare, an issue triggerable from userspace must be fixed regardless of its likelihood. This patch fixes the out-of-bounds access by refactoring the logic into a new helper, folio_unmap_pte_batch(). The new helper correctly calculates the safe batch size by capping the scan at both the VMA and PMD boundaries. To simplify the code, it also supports partial batching (i.e., any number of pages from 1 up to the calculated safe maximum), as there is no strong reason to special-case for fully mapped folios. The Linux kernel CVE team has assigned CVE-2025-38447 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 354dffd29575cdf13154e8fb787322354aa9efc4 and fixed in 6.15.7 with commit 510fe9c15d07e765d96be9a9dc37e5057c6c09f4 Issue introduced in 6.15 with commit 354dffd29575cdf13154e8fb787322354aa9efc4 and fixed in 6.16-rc6 with commit ddd05742b45b083975a0855ef6ebbf88cf1f532a 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-38447 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/rmap.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/510fe9c15d07e765d96be9a9dc37e5057c6c09f4 https://git.kernel.org/stable/c/ddd05742b45b083975a0855ef6ebbf88cf1f532a