[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025090728-CVE-2025-39727-b07c@gregkh>
Date: Sun, 7 Sep 2025 17:16:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-39727: mm: swap: fix potential buffer overflow in setup_clusters()
From: Greg Kroah-Hartman <gregkh@...nel.org>
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
Powered by blists - more mailing lists