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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.27% (percentile 12, 2026-11-26)
- **Published:** 2025-07-04T13:37:27.508Z
- **Modified:** 2026-10-21T13:18:09.723Z

## Who should check

- Anyone running Linux \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 7030046a9b4de8199a3cbc3de20366d95dce2142; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 2b12d06c37fd3a394376f42f026a7478d826ed63
- Anyone running Linux 3.5

## 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/

## Affected and fixed versions

- Linux: \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 7030046a9b4de8199a3cbc3de20366d95dce2142; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 2b12d06c37fd3a394376f42f026a7478d826ed63 (cvelist)
- Linux: 3.5 (cvelist)

## Mitigation

- Upgrade Linux to 2b12d06c37fd3a394376f42f026a7478d826ed63 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38207. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38207.md
Affected: Linux >= 2b144498350860b6ee9dc57ff27a93ad488de5dc, < 7030046a9b4de8199a3cbc3de20366d95dce2142; >= 2b144498350860b6ee9dc57ff27a93ad488de5dc, < 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0; >= 2b144498350860b6ee9dc57ff27a93ad488de5dc, < 2b12d06c37fd3a394376f42f026a7478d826ed63; Linux 3.5
Fixed in: Linux 7030046a9b4de8199a3cbc3de20366d95dce2142, Linux 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0, Linux 2b12d06c37fd3a394376f42f026a7478d826ed63

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38207 being exploited?

There is no confirmed exploitation: CVE-2025-38207 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.27% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38207?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38207?

Linux \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 7030046a9b4de8199a3cbc3de20366d95dce2142; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0; \>= 2b144498350860b6ee9dc57ff27a93ad488de5dc, \< 2b12d06c37fd3a394376f42f026a7478d826ed63; Linux 3.5.

### Is there a fix for CVE-2025-38207?

Yes. Fixed in Linux 7030046a9b4de8199a3cbc3de20366d95dce2142, Linux 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0, Linux 2b12d06c37fd3a394376f42f026a7478d826ed63. Upgrade Linux to 2b12d06c37fd3a394376f42f026a7478d826ed63 or later.

### How do I check if I'm affected by CVE-2025-38207?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0>
- patch: <https://git.kernel.org/stable/c/2b12d06c37fd3a394376f42f026a7478d826ed63>
- other: <https://git.kernel.org/stable/c/7030046a9b4de8199a3cbc3de20366d95dce2142>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38207>

HTML: <https://flawdb.com/CVE-2025-38207> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38207>
