Cloudanix VulnDB

CVE-2025-38207

None

CVSS

—

EPSS

0.2%

Published

Jul 4, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A Linux kernel bug can cause memory tracking to break when certain debugging features and memory-moving operations happen together, potentially crashing programs or the system itself.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw allows a sequence of mremap operations on a VMA with a registered uprobe at file offset zero to cause the uprobe-installed anonymous PTE to be overwritten during vma_merge_new_range followed by move_page_tables, leaving an orphan PTE and corrupting the MM_ANONPAGES RSS counter.

Why it matters to the business

Kernel memory accounting becomes inconsistent on systems performing uprobe-based tracing or debugging combined with memory remapping, potentially leading to application instability, unexpected process termination, or kernel BUG conditions in production workloads that rely on dynamic memory mapping.

How an attack unfolds

An attacker registers an uprobe on a file at offset zero, then uses a crafted sequence of mmap followed by two mremap calls (one expanding the range and one moving it back with MREMAP_FIXED) to trigger vma merging; the subsequent uprobe_mmap in vma_complete installs a PTE that is immediately overwritten by set_pte_at during move_page_tables, orphaning the page table entry.

How to fix it

Upgrade the Linux kernel to a version containing commit 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0 or later; for affected packaged distributions such as azure-service-operator-fips apply version 2.13.0-r2 or newer.

How to confirm the fix worked

Confirm the running kernel contains commit 58b83b9a9a929611a2a2e7d88f45cb0d786b7ee0, reproduce the original Syzkaller reproducer steps and verify absence of the MM_ANONPAGES RSS counter BUG, and ensure uprobe PTEs remain correctly installed after repeated mremap operations on merged VMAs.

Typical attack path

  1. Register uprobe on target file at offset zero
  2. mmap the file with PROT_NONE at the same offset
  3. Perform mremap to expand and relocate the VMA
  4. Perform second mremap with MREMAP_FIXED to merge ranges
  5. Trigger uprobe_mmap on merged VMA followed by move_page_tables to overwrite PTE

How to detect it

Search kernel logs and dmesg output across all hosts for "BUG: Bad rss-counter state" entries mentioning MM_ANONPAGES; inspect audit or tracing logs for sequences of uprobe registration immediately followed by mremap syscalls on the same file offset.

What your security team should do

  • Prioritize kernel upgrades on all systems using uprobes or dynamic memory mapping workloads within the next maintenance window
  • Monitor kernel logs for "Bad rss-counter state" messages on hosts performing mremap or uprobe activity
  • Apply the fixed commit or packaged update listed for each distribution and reboot affected nodes

The record

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 packages

Ecosystem Package Introduced Fixed
Chainguard hyperv-daemons-6.12 0 6.12.57-r2
Chainguard linux-aws-6.12-boot-installed 0 6.12.57-r2
Chainguard linux-aws-6.12-fips-boot-installed 0 6.12.57-r2
Chainguard linux-aws-6.12-headers 0 6.12.57-r2
Chainguard linux-aws-6.12-modules 0 6.12.57-r2
Chainguard linux-azure-6.12-boot-installed 0 6.12.57-r2
Chainguard linux-azure-6.12-fips-boot-installed 0 6.12.57-r2
Chainguard linux-azure-6.12-headers 0 6.12.57-r2
Chainguard linux-azure-6.12-modules 0 6.12.57-r2
Chainguard linux-gcp-6.12-boot-installed 0 6.12.58-r0
Chainguard linux-gcp-6.12-fips-boot-installed 0 6.12.57-r2
Chainguard linux-gcp-6.12-headers 0 6.12.57-r2
Chainguard linux-gcp-6.12-modules 0 6.12.57-r2
Chainguard linux-qemu-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-headers 0 6.12.63-r0
Chainguard linux-qemu-6.12-modules 0 6.12.63-r0
Chainguard linux-vmware-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-headers 0 6.12.63-r0
Chainguard linux-vmware-6.12-modules 0 6.12.63-r0
Debian:11 linux 0 No fix
Debian:12 linux 0 No fix
Debian:13 linux 0 No fix
Debian:14 linux 0 6.16.3-1
Linux Kernel 3.5.0 6.15.4

Related vulnerabilities