CVE-2025-22090 x86/mm/pat: Fix VM_PAT handling when fork() fails in copy_page_range()
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- Linux KernelUbuntuDebian
Description
In the Linux kernel, the following vulnerability has been resolved:
x86/mm/pat: Fix VM_PAT handling when fork() fails in copy_page_range()
If track_pfn_copy() fails, we already added the dst VMA to the maple
tree. As fork() fails, we'll cleanup the maple tree, and stumble over
the dst VMA for which we neither performed any reservation nor copied
any page tables.
Consequently untrack_pfn() will see VM_PAT and try obtaining the
PAT information from the page table -- which fails because the page
table was not copied.
The easiest fix would be to simply clear the VM_PAT flag of the dst VMA
if track_pfn_copy() fails. However, the whole thing is about "simply"
clearing the VM_PAT flag is shaky as well: if we passed track_pfn_copy()
and performed a reservation, but copying the page tables fails, we'll
simply clear the VM_PAT flag, not properly undoing the reservation ...
which is also wrong.
So let's fix it properly: set the VM_PAT flag only if the reservation
succeeded (leaving it clear initially), and undo the reservation if
anything goes wrong while copying the page tables: clearing the VM_PAT
flag after undoing the reservation.
Note that any copied page table entries will get zapped when the VMA will
get removed later, after copy_page_range() succeeded; as VM_PAT is not set
then, we won't try cleaning VM_PAT up once more and untrack_pfn() will be
happy. Note that leaving these page tables in place without a reservation
is not a problem, as we are aborting fork(); this process will never run.
A reproducer can trigger this usually at the first try:
https://gitlab.com/davidhildenbrand/scratchspace/-/raw/main/reproducers/pat_fork.c
WARNING: CPU: 26 PID: 11650 at arch/x86/mm/pat/memtype.c:983 get_pat_info+0xf6/0x110
Modules linked in: ...
CPU: 26 UID: 0 PID: 11650 Comm: repro3 Not tainted 6.12.0-rc5+ #92
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-2.fc40 04/01/2014
RIP: 0010:get_pat_info+0xf6/0x110
...
Call Trace:
<TASK>
...
untrack_pfn+0x52/0x110
unmap_single_vma+0xa6/0xe0
unmap_vmas+0x105/0x1f0
exit_mmap+0xf6/0x460
__mmput+0x4b/0x120
copy_process+0x1bf6/0x2aa0
kernel_clone+0xab/0x440
__do_sys_clone+0x66/0x90
do_syscall_64+0x95/0x180
Likely this case was missed in:
d155df53f310 ("x86/mm/pat: clear VM_PAT if copy_p4d_range failed")
... and instead of undoing the reservation we simply cleared the VM_PAT flag.
Keep the documentation of these functions in include/linux/pgtable.h,
one place is more than sufficient -- we should clean that up for the other
functions like track_pfn_remap/untrack_pfn separately.
Upgrade path
16 packages: 6 fixed, 10 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| cbl-mariner kernel(CBL-Mariner 2.0) | All versions | No fix listed | No fix yet |
| Microsoft cbl2 kernel 5.15.202.1-1 | All versions | No fix listed | No fix yet |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) | >= V3.1.6; >= V3.1.7 | No fix listed | No fix yet |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) | >= V3.1.6; >= V3.1.7 | No fix listed | No fix yet |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) | >= V3.1.6; >= V3.1.7 | No fix listed | No fix yet |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) | >= V3.1.6; >= V3.1.7 | No fix listed | No fix yet |
| Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) | >= V3.1.6; >= V3.1.7 | No fix listed | No fix yet |
| ubuntu/linux(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/linux-kvm(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/linux-raspi(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| debian/linux(Debian 12) | < 6.1.162-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +43 more | 6.1.162-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| Linux kernel | < 6.1.160; < 6.6.87; < 6.12.23; < 6.13.11 +13 more | 6.1.160, 6.6.87, 6.12.23, 6.13.11, 6.14.2, 6.15, 8d6373f83f367dbed316ddeb178130a3a64b5b67, a6623712ba8449876f0b3de9462831523fb851e4, b07398e8a5da517083f5c3f2daa8f6681b48ab28, da381c33f3aa6406406c9fdf07b8b0b63e0ce722, dc84bc2aba85a1508f04a936f9f9a15f64ebfb31, de6185b8892d88142ef69768fe4077cbf40109c0 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-86.87 | 6.8.0-86.87 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1041.45 | 6.8.0-1041.45 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| cbl-mariner kernel(CBL-Mariner:2.0) | All versions | No fix listed |
| Microsoft cbl2 kernel 5.15.202.1-1 | All versions | No fix listed |
| debian/linux(Debian:12) | < 6.1.162-1 | 6.1.162-1 |
| debian/linux(Debian:12) | = 6.1.106-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.112-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.115-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.119-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.135-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.137-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.139-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.140-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.147-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.148-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.153-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.158-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.159-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
Show 58 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.98-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.99-1 | No fix listed |
| debian/linux(Debian:13) | < 6.12.25-1 | 6.12.25-1 |
| debian/linux(Debian:14) | < 6.12.25-1 | 6.12.25-1 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < a6623712ba8449876f0b3de9462831523fb851e4 | a6623712ba8449876f0b3de9462831523fb851e4 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < b07398e8a5da517083f5c3f2daa8f6681b48ab28 | b07398e8a5da517083f5c3f2daa8f6681b48ab28 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < 8d6373f83f367dbed316ddeb178130a3a64b5b67 | 8d6373f83f367dbed316ddeb178130a3a64b5b67 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < da381c33f3aa6406406c9fdf07b8b0b63e0ce722 | da381c33f3aa6406406c9fdf07b8b0b63e0ce722 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < de6185b8892d88142ef69768fe4077cbf40109c0 | de6185b8892d88142ef69768fe4077cbf40109c0 |
| Linux kernel | >= 2ab640379a0ab4cef746ced1d7e04a0941774bcb, < dc84bc2aba85a1508f04a936f9f9a15f64ebfb31 | dc84bc2aba85a1508f04a936f9f9a15f64ebfb31 |
| Linux kernel | = 2.6.29 | No fix listed |
| Linux kernel | < 6.1.160 | 6.1.160 |
| Linux kernel | < 6.6.87 | 6.6.87 |
| Linux kernel | < 6.12.23 | 6.12.23 |
| Linux kernel | < 6.13.11 | 6.13.11 |
| Linux kernel | < 6.14.2 | 6.14.2 |
| Linux kernel | < 6.15 | 6.15 |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) | >= V3.1.6 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0) | >= V3.1.7 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) | >= V3.1.6 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0) | >= V3.1.7 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) | >= V3.1.6 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) | >= V3.1.7 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) | >= V3.1.6 | No fix listed |
| Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AC0) | >= V3.1.7 | No fix listed |
| Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) | >= V3.1.6 | No fix listed |
| Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP (6AG1518-4AX00-4AC0) | >= V3.1.7 | No fix listed |
| ubuntu/linux(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/linux-kvm(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/linux-raspi(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-86.87 | 6.8.0-86.87 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1041.45 | 6.8.0-1041.45 |
| Linux kernel | >= 2.6.29, < 6.6.87 | 6.6.87 |
| Linux kernel | >= 6.7, < 6.12.23 | 6.12.23 |
| Linux kernel | >= 6.13, < 6.13.11 | 6.13.11 |
| Linux kernel | >= 6.14, < 6.14.2 | 6.14.2 |
References
- MSRC Security Update Guide vendor-advisory
- Release Notes vendor-advisory
- Debian Security Tracker CVE-2025-22090 vendor-advisory
- git.kernel.org
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- cert-portal.siemens.com
- cert-portal.siemens.com
- Ubuntu CVE tracker vendor-advisory
- USN-7594-1 vendor-advisory
- USN-7594-2 vendor-advisory
- USN-7605-1 vendor-advisory
- USN-7606-1 vendor-advisory
- USN-7605-2 vendor-advisory
- USN-7594-3 vendor-advisory
- USN-7628-1 vendor-advisory
- USN-7835-1 vendor-advisory
- USN-7835-2 vendor-advisory
- USN-7835-3 vendor-advisory
- USN-7835-4 vendor-advisory
- USN-7835-5 vendor-advisory
- USN-7835-6 vendor-advisory
- USN-7887-1 vendor-advisory
- USN-7887-2 vendor-advisory
- USN-7940-1 vendor-advisory
- USN-7940-2 vendor-advisory
- www.cve.org
- ENISA EUVD EUVD-2025-11206 third-party-advisory