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 211531DDA14 for ; Sun, 7 Sep 2025 15:16:37 +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=1757258198; cv=none; b=e88wekXmEgU6WNyb0dlfBwbQISxczeZP2EucJAhO3Qxct19nu7v5W5gCuUCdGGJI013XaLfIfMRzR932Rlf67hO0fBAmoLQ0YJs0OCCynQ+vk7hg5jLs7e0056MwkpXKyZYX0xYbBSGq7ddUi5UUoCMnI+AUG3fr+1SRP1OmEzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757258198; c=relaxed/simple; bh=ul6yzYnY2lU3yNlfCpNtt1vqhf9nYNMFtp6nM393Zj0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hibmIrEGHvVLuEctlMg9d+QuP0Ul9Qi3hQ6QbqHw25PfRP8s3eCWyBebCUTA2wmNTs0OkSRbtBZRf/S94xtL5cWfUYL+1cEuzhobtBY9WFd84cSCqDMsRm9nmo8HRyo17w3DNpcbckW2qEKMP106EZKBQf5MRCwYAY35396//Zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cEABFhdB; 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="cEABFhdB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10D40C4CEF0; Sun, 7 Sep 2025 15:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757258197; bh=ul6yzYnY2lU3yNlfCpNtt1vqhf9nYNMFtp6nM393Zj0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=cEABFhdBtcDtGqB6FE8HdHa84wGT8PSjTykRfEuoHy77I6zPp0vPjQoGJiyEL/deE 1BpZwT0dFTVtxxdT4y87CtaPeOXw8VfdFD0ITStX28UnLoNrWl57N9Rq3+9YympBIt MBLOK9F0bbCSpoGJo3VZi44XcNawNHymqBINjURc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39727: mm: swap: fix potential buffer overflow in setup_clusters() Date: Sun, 7 Sep 2025 17:16:29 +0200 Message-ID: <2025090728-CVE-2025-39727-b07c@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=2497; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Htr1nF3Y0P2boAq64MMy8rUhFsAyuFsyoK6BYv0ccG4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl7F54p5ClhsxM3/Bshc3BH+UbPGRabK97H/qxILHvfP ycuRNqyI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZyeB3Dgg6NoyvK7yy/vTfh TKLhgi8Tat+uMmBYsPjfxclXVHhWBDz6xis+df6/ewLFaQA= 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: swap: fix potential buffer overflow in setup_clusters() In setup_swap_map(), we only ensure badpages are in range (0, last_page]. As maxpages might be < last_page, setup_clusters() will encounter a buffer overflow when a badpage is >= maxpages. Only call inc_cluster_info_page() for badpage which is < maxpages to fix the issue. The Linux kernel CVE team has assigned CVE-2025-39727 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit b843786b0bd01ced7fcdbf3b033d68db2f7c61b2 and fixed in 6.12.42 with commit 91b370800b3f2b3dda244c0ab06719c4971190a5 Issue introduced in 6.12 with commit b843786b0bd01ced7fcdbf3b033d68db2f7c61b2 and fixed in 6.15.10 with commit 9b01ada580ee84fb319e7ecb5fb5b1f54a9eb799 Issue introduced in 6.12 with commit b843786b0bd01ced7fcdbf3b033d68db2f7c61b2 and fixed in 6.16.1 with commit 815c528b13f2bb9b3130c13bedeabf2351a68129 Issue introduced in 6.12 with commit b843786b0bd01ced7fcdbf3b033d68db2f7c61b2 and fixed in 6.17-rc1 with commit 152c1339dc13ad46f1b136e8693de15980750835 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-39727 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/swapfile.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/91b370800b3f2b3dda244c0ab06719c4971190a5 https://git.kernel.org/stable/c/9b01ada580ee84fb319e7ecb5fb5b1f54a9eb799 https://git.kernel.org/stable/c/815c528b13f2bb9b3130c13bedeabf2351a68129 https://git.kernel.org/stable/c/152c1339dc13ad46f1b136e8693de15980750835