# CVE-2025-38207: mm: fix uprobe pte be overwritten when expanding vma

CVE-2025-38207 is fixed in linux on 1 platform, first by DEBIAN-CVE-2025-38207, released July 4, 2025. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2025-38207
- Priority: Routine
- CVSS: 5.5 (medium)
- EPSS: 0.0022
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jul 4, 2025
- Vendor advisory: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-38207

## Description

In the Linux kernel, the following vulnerability has been resolved:  mm: fix uprobe pte be overwritten when expanding vma  Patch series "Fix uprobe pte be overwritten when expanding vma".   This patch (of 4):  We encountered a BUG alert triggered by Syzkaller as follows:    BUG: Bad rss-counter state mm:00000000b4a60fca type:MM_ANONPAGES val:1  And we can reproduce it with the following steps: 1. register uprobe on file at zero offset 2. mmap the file at zero offset:    addr1 = mmap(NULL, 2 * 4096, PROT_NONE, MAP_PRIVATE, fd, 0); 3. mremap part of vma1 to new vma2:    addr2 = mremap(addr1, 4096, 2 * 4096, MREMAP_MAYMOVE); 4. mremap back to orig addr1:    mremap(addr2, 4096, 4096, MREMAP_MAYMOVE | MREMAP_FIXED, addr1);  In step 3, the vma1 range [addr1, addr1 + 4096] will be remap to new vma2 with range [addr2, addr2 + 8192], and remap uprobe anon page from the vma1 to vma2, then unmap the vma1 range [addr1, addr1 + 4096].  In step 4, the vma2 range [addr2, addr2 + 4096] will be remap back to the addr range [addr1, addr1 + 4096].  Since the addr range [addr1 + 4096, addr1 + 8192] still maps the file, it will take vma_merge_new_range to expand the range, and then do uprobe_mmap in vma_complete.  Since the merged vma pgoff is also zero offset, it will install uprobe anon page to the merged vma.  However, the upcomming move_page_tables step, which use set_pte_at to remap the vma2 uprobe pte to the merged vma, will overwrite the newly uprobe pte in the merged vma, and lead that pte to be orphan.  Since the uprobe pte will be remapped to the merged vma, we can remove the unnecessary uprobe_mmap upon merged vma.  This problem was first found in linux-6.6.y and also exists in the community syzkaller: https://lore.kernel.org/all/000000000000ada39605a5e71711@google.com/T/

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | linux Debian 13.5 (trixie) | 6.12.115-2 | [DEBIAN-CVE-2025-38207](https://patchblox.com/security/data/fix/linux/debian-cve-2025-38207.md) | Jul 4, 2025 |
| Linux | linux Debian 14 | 6.16.3-1 | [DEBIAN-CVE-2025-38207](https://patchblox.com/security/data/fix/linux/debian-cve-2025-38207.md) | Jul 4, 2025 |

---

Data as of 2026-11-08T13:06:02Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
