CVE-2025-39776

7.8 HIGH

📋 TL;DR

A use-after-free vulnerability in the Linux kernel's debug_vm_pgtable test module allows stale page table entries to persist after test completion. When another process allocates memory at the same address, it may encounter corrupted page table entries, potentially leading to kernel crashes or memory corruption. This affects systems with CONFIG_DEBUG_VM_PGTABLE=y enabled in debug kernels.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Specific affected versions not explicitly stated, but patches available for stable kernel trees
Operating Systems: Linux distributions with vulnerable kernel versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when CONFIG_DEBUG_VM_PGTABLE=y is enabled, which is typically only in debug/development kernels, not production kernels.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic, system crash, or potential privilege escalation if an attacker can trigger memory corruption leading to arbitrary code execution in kernel context.

🟠

Likely Case

Kernel crashes or system instability when debug_vm_pgtable tests run and subsequent processes allocate memory at the same addresses.

🟢

If Mitigated

Minimal impact if CONFIG_DEBUG_VM_PGTABLE is disabled or systems are not running debug kernels.

🌐 Internet-Facing: LOW - Requires local access and specific debug kernel configuration.
🏢 Internal Only: MEDIUM - Could affect development/testing systems with debug kernels, potentially causing system instability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: HIGH

Exploitation requires local access, debug kernel configuration, and specific conditions to trigger the stale page table entry issue.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in stable kernel trees (commits: 47d2a149611b8a94d24add9868c442a4af278658, 561171db3b3eb759ba3f284dba7a76f4476ade03, 61a9f2e5c49f05e3ea2c16674540a075a1b4be6f, 63962ff932ef359925b94be2a88df6b4fd4fed0a, 7bf57a0709cd7c9088cea8de023d6f4fbf2518b0)

Vendor Advisory: https://git.kernel.org/stable/c/47d2a149611b8a94d24add9868c442a4af278658

Restart Required: Yes

Instructions:

1. Update to a patched kernel version from your distribution vendor. 2. Rebuild kernel if using custom kernel with CONFIG_DEBUG_VM_PGTABLE=y. 3. Reboot system to load new kernel.

🔧 Temporary Workarounds

Disable debug_vm_pgtable module

linux

Disable CONFIG_DEBUG_VM_PGTABLE in kernel configuration to prevent the vulnerable code from being compiled.

# Reconfigure kernel with CONFIG_DEBUG_VM_PGTABLE=n
# Rebuild and install kernel

Avoid debug kernels in production

linux

Use production kernels without debug options enabled instead of debug kernels.

🧯 If You Can't Patch

  • Ensure production systems are not running debug kernels with CONFIG_DEBUG_VM_PGTABLE=y
  • Restrict access to systems with debug kernels to trusted users only

🔍 How to Verify

Check if Vulnerable:

Check kernel config: grep CONFIG_DEBUG_VM_PGTABLE /boot/config-$(uname -r) or /proc/config.gz. If 'y' and kernel version is unpatched, system is vulnerable.

Check Version:

uname -r

Verify Fix Applied:

Check kernel version is patched and CONFIG_DEBUG_VM_PGTABLE is either 'n' or kernel includes the fix commits.

📡 Detection & Monitoring

Log Indicators:

  • Kernel warnings about 'Bad rss-counter state'
  • Warnings about 'non-zero pgtables_bytes on freeing mm'
  • Kernel panics or crashes after debug_vm_pgtable tests

SIEM Query:

kernel:WARNING AND ("Bad rss-counter state" OR "non-zero pgtables_bytes on freeing mm")

🔗 References

📤 Share & Export