CVE-2025-40270
published high CVSS 3.1 · 7.8mm, swap: fix potential UAF issue for VMA readahead
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux78524b05f1a3e16a5d00cc9c6259c41a9d6003ce to < a4145be7b56bfa87dce56415c3ad993071462b8a · 78524b05f1a3e16a5d00cc9c6259c41a9d6003ce to < 1c2a936edd71e133f2806e68324ec81a4eb07588 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.15 (affected) · 0 to < 6.15 (unaffected · semver) · 6.17.9 through 6.17.* (unaffected · semver) · 6.18 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Ubuntu | noble | linux-buildinfo-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-headers-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-image-unsigned-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
Show 96 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | noble | linux-modules-evdi-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-ipu6-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-ipu7-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-iwlwifi-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-usbio-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-modules-vision-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-oem-6.17 | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-oem-6.17-headers-6.17.0-1011 | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-oem-6.17-tools-6.17.0-1011 | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | noble | linux-tools-6.17.0-1011-oem | Advisory build | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu | questing | bpftool | Advisory build | 7.7.0+6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-aws-cloud-tools-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-aws-headers-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-aws-tools-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-azure-cloud-tools-6.17.0-1008 | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-azure-headers-6.17.0-1008 | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-azure-tools-6.17.0-1008 | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-aws-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-gcp | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-gcp-64k | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-oracle | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1007-oracle-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1008-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-buildinfo-6.17.0-1008-raspi | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-buildinfo-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-buildinfo-6.17.0-14-generic-64k | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-1007-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-1007-aws-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-1008-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-14 | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-cloud-tools-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-cloud-tools-common | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-gcp | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-gcp-headers-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-gcp-tools-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-headers-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-headers-6.17.0-1007-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-headers-6.17.0-1007-aws-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-headers-6.17.0-1007-gcp | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-headers-6.17.0-1007-gcp-64k | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-headers-6.17.0-1007-oracle | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-headers-6.17.0-1007-oracle-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-headers-6.17.0-1008-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-headers-6.17.0-1008-raspi | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-headers-6.17.0-14 | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-headers-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-headers-6.17.0-14-generic-64k | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-image-6.17.0-1008-raspi | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-image-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-aws-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-gcp | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-gcp-64k | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-oracle | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1007-oracle-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-1008-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-image-unsigned-6.17.0-14-generic-64k | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-lib-rust-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-modules-6.17.0-1007-aws | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-modules-6.17.0-1007-aws-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-modules-6.17.0-1007-gcp | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-modules-6.17.0-1007-gcp-64k | Advisory build | 6.17.0-1007.7 | USN-8030-1 |
| Ubuntu | questing | linux-modules-6.17.0-1007-oracle | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-modules-6.17.0-1007-oracle-64k | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-modules-6.17.0-1008-azure | Advisory build | 6.17.0-1008.8 | USN-8029-3 |
| Ubuntu | questing | linux-modules-6.17.0-1008-raspi | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-modules-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-6.17.0-14-generic-64k | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-ipu6-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-ipu7-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-iwlwifi-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-modules-iwlwifi-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-usbio-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-modules-vision-6.17.0-14-generic | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-oracle | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-oracle-headers-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-oracle-tools-6.17.0-1007 | Advisory build | 6.17.0-1007.7 | USN-8029-2 |
| Ubuntu | questing | linux-perf | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-raspi | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-raspi-headers-6.17.0-1008 | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-raspi-tools-6.17.0-1008 | Advisory build | 6.17.0-1008.8 | USN-8029-1 |
| Ubuntu | questing | linux-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-realtime-cloud-tools-6.17.0-1006 | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-realtime-headers-6.17.0-1006 | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-realtime-tools-6.17.0-1006 | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu | questing | linux-source-6.17.0 | Advisory build | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu | questing | linux-tools-6.17.0-1006-realtime | Advisory build | 6.17.0-1006.7 | USN-8029-1 |
Package entries are limited to the first 100 builds and 100 linked advisories.
Description
In the Linux kernel, the following vulnerability has been resolved: mm, swap: fix potential UAF issue for VMA readahead Since commit 78524b05f1a3 ("mm, swap: avoid redundant swap device pinning"), the common helper for allocating and preparing a folio in the swap cache layer no longer tries to get a swap device reference internally, because all callers of __read_swap_cache_async are already holding a swap entry reference. The repeated swap device pinning isn't needed on the same swap device. Caller of VMA readahead is also holding a reference to the target entry's swap device, but VMA readahead walks the page table, so it might encounter swap entries from other devices, and call __read_swap_cache_async on another device without holding a reference to it. So it is possible to cause a UAF when swapoff of device A raced with swapin on device B, and VMA readahead tries to read swap entries from device A. It's not easy to trigger, but in theory, it could cause real issues. Make VMA readahead try to get the device reference first if the swap device is a different one from the target entry.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The vulnerable code is reached purely through local memory operations — an ordinary page fault on a swapped-out anonymous page (`do_swap_page` → `swapin_readahead` → `swap_vma_readahead`), with swap PTEs placed on demand via `madvise(MADV_PAGEOUT)`. No network or remote-peer data is involved. AC:L - The attacker fully owns and can indefinitely retry the swapin side — unlimited faulting threads over regions deliberately paged out across multiple swap devices — and can hold the window open through the `SWAP_HAS_CACHE` contention path in `__read_swap_cache_async()`, whose `schedule_timeout_uninterruptible(1)` retry loop re-dereferences the stale `si->cluster_info` after each sleep; no attacker-unknowable memory layout is required. The only element not directly issued by the attacker is `swapoff(2)`, which is a routine, repeatable system event (hibernate, `swapoff -a`, zram/swapfile reconfiguration) that a resident exploit simply waits for. PR:L - The attacker-controlled half of the race needs nothing beyond an ordinary unprivileged local account: `mmap`, `madvise(MADV_PAGEOUT)` and touching the memory are unrestricted, and `swap_vma_readahead()` has no capability check on any part of its path. UI:N - The attacker drives the faulting/readahead side entirely from its own threads with no victim cooperation; the concurrent swapoff is normal unattended system activity (hibernation, maintenance, swap reconfiguration), not an action solicited from a user. S:U - The corruption is confined to kernel data structures (`swap_info_struct::cluster_info`, `swap_map`, swap-table pages) managed by the same kernel security authority; no hypervisor, IOMMU, or sandbox boundary is crossed. C:H - `swap_table_get()` follows a `ci->table` pointer read out of the kvfree'd `cluster_info` array and `swp_tb_to_folio()` casts the resulting value straight to `struct folio *`, which `do_swap_page()` then maps into the faulting process's page tables — once the freed allocation is reclaimed with groomed content this yields disclosure of arbitrary kernel/physical memory into userspace. I:H - `swap_cluster_lock()` performs `spin_lock(&ci->lock)`, a write into the freed cluster array, at an offset that is no longer bounds-checked because the dropped `get_swap_device()` also carried the `offset >= si->max` validation; combined with `folio_try_get()` incrementing a refcount at an attacker-influenced address and mapping a fabricated folio into the process, this provides write primitives suitable for local privilege escalation. A:H - Swapoff clears `si->cluster_info`, `si->swap_map` and `si->max` to NULL/0 after freeing them, so the racing readahead dereferences freed or NULL pointers inside the page-fault path, producing a kernel oops/panic, and the race can be re-run continuously.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 78524b05f1a3e16a5d00cc9c6259c41a9d6003ce to < a4145be7b56bfa87dce56415c3ad993071462b8a (affected · git)78524b05f1a3e16a5d00cc9c6259c41a9d6003ce to < 1c2a936edd71e133f2806e68324ec81a4eb07588 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.15 (affected)0 to < 6.15 (unaffected · semver)6.17.9 through 6.17.* (unaffected · semver)6.18 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
mm, swap: fix potential UAF issue for VMA readahead
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 61cdf39b2d5b8b9a8502473823e3036862afbcb70ea551799e0000c20f00ac7b
- Ingested
- 23 Sep 2026, 08:48:04 UTC
- Source record
- Official CVE record