CVE-2025-22015
mm/migrate: fix shmem xarray update during migration
Check your servers for CVE-2025-22015
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-22015 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
mm/migrate: fix shmem xarray update during migration
A shmem folio can be either in page cache or in swap cache, but not at the same time. Namely, once it is in swap cache, folio->mapping should be NULL, and the folio is no longer in a shmem mapping.
In __folio_migrate_mapping(), to determine the number of xarray entries to update, folio_test_swapbacked() is used, but that conflates shmem in page cache case and shmem in swap cache case. It leads to xarray multi-index entry corruption, since it turns a sibling entry to a normal entry during xas_store() (see [1] for a userspace reproduction). Fix it by only using folio_test_swapcache() to determine whether xarray is storing swap cache entries or not to choose the right number of xarray entries to update.
[1] https://lore.kernel.org/linux-mm/Z8idPCkaJW1IChjT@casper.infradead.org/
Note: In __split_huge_page(), folio_test_anon() && folio_test_swapcache() is used to get swap_cache address space, but that ignores the shmem folio in swap cache case. It could lead to NULL pointer dereferencing when a in-swap-cache shmem folio is split at __xa_store(), since !folio_test_anon() is true and folio->mapping is NULL. But fortunately, its caller split_huge_page_to_list_to_order() bails out early with EBUSY when folio->mapping is NULL. So no need to take care of it here.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.23%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.2% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 15 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from be72d197b2281e2ee3f28017fc9be1ab17e26d16, before 49100c0b070e900f87c8fac3be9b9ef8a30fa673 affected from 07550b1461d4d0499165e7d6f7718cfd0e440427, before 29124ae980e2860f0eec7355949d3d3292ee81da affected from fc346d0a70a13d52fe1c4bc49516d83a42cd7c4c, before c057ee03f751d6cecf7ee64f52f6545d94082aaa affected from fc346d0a70a13d52fe1c4bc49516d83a42cd7c4c, before 75cfb92eb63298d717b6b0118f91ba12c4fcfeb5 affected from fc346d0a70a13d52fe1c4bc49516d83a42cd7c4c, before 60cf233b585cdf1f3c5e52d1225606b86acd08b0 affected from 6.1.71, before 6.1.132 affected from 6.6.10, before 6.6.85
Other versions: unaffected
|
| Linux |
affected 6.7 unaffected before 6.7 unaffected from 6.1.132 up to and including 6.1.* unaffected from 6.6.85 up to and including 6.6.* unaffected from 6.12.21 up to and including 6.12.* unaffected from 6.13.9 up to and including 6.13.* unaffected 6.14 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-22015 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-22015
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-22015
trivy image --scanners vuln IMAGE | grep CVE-2025-22015
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/49100c0b070e900f87c8fac3be9b9ef8a30fa673 git.kernel.org
- https://git.kernel.org/stable/c/29124ae980e2860f0eec7355949d3d3292ee81da git.kernel.org
- https://git.kernel.org/stable/c/c057ee03f751d6cecf7ee64f52f6545d94082aaa git.kernel.org
- https://git.kernel.org/stable/c/75cfb92eb63298d717b6b0118f91ba12c4fcfeb5 git.kernel.org
- https://git.kernel.org/stable/c/60cf233b585cdf1f3c5e52d1225606b86acd08b0 git.kernel.org
- https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html lists.debian.org
- https://cert-portal.siemens.com/productcert/html/ssa-019113.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-457936.html cert-portal.siemens.com
Source: the record CVE-2025-22015 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse