CVE-2025-39704

5.5 MEDIUM

📋 TL;DR

A stack buffer overflow vulnerability exists in the Linux kernel's KVM (Kernel-based Virtual Machine) implementation for LoongArch architecture. When CONFIG_STACKPROTECTOR is enabled, the send_ipi_data() function can be exploited to corrupt kernel memory, potentially leading to system crashes or privilege escalation. This affects systems running Linux kernels with KVM enabled on LoongArch hardware.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Linux kernel versions before the fix commit 5c68549c81bcca70fc464e305ffeefd9af968287
Operating Systems: Linux distributions with KVM support on LoongArch architecture
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with: 1) LoongArch CPU architecture, 2) KVM virtualization enabled, 3) CONFIG_STACKPROTECTOR enabled (default in most distributions)

📦 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 →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to denial of service, or potential privilege escalation allowing attackers to execute arbitrary code in kernel context.

🟠

Likely Case

Kernel panic and system crash when the vulnerability is triggered, causing denial of service for virtual machines and the host system.

🟢

If Mitigated

System remains stable if CONFIG_STACKPROTECTOR is disabled, though this reduces overall security posture.

🌐 Internet-Facing: LOW - Requires access to KVM interface which is typically not exposed to external networks.
🏢 Internal Only: MEDIUM - Malicious users with access to create or manage KVM virtual machines could trigger the vulnerability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires access to KVM interface and ability to trigger specific emulation functions. The vulnerability is triggered through normal KVM operations when buffer size constraints are violated.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Linux kernel with commit 5c68549c81bcca70fc464e305ffeefd9af968287 or later

Vendor Advisory: https://git.kernel.org/stable/c/5c68549c81bcca70fc464e305ffeefd9af968287

Restart Required: No

Instructions:

1. Update Linux kernel to version containing the fix commit. 2. For distributions: Apply kernel security updates from your vendor. 3. Recompile kernel if building from source with the patched code.

🔧 Temporary Workarounds

Disable CONFIG_STACKPROTECTOR

all

Disable stack protector feature in kernel configuration to prevent the buffer overflow detection from triggering kernel panic

Rebuild kernel with CONFIG_STACKPROTECTOR=n in kernel configuration

Disable KVM on LoongArch

all

Disable KVM virtualization support if not required

Remove kvm modules: rmmod kvm
Prevent loading: echo 'blacklist kvm' >> /etc/modprobe.d/blacklist.conf

🧯 If You Can't Patch

  • Restrict KVM access to trusted users only
  • Monitor system logs for stack protector failures and kernel panic events

🔍 How to Verify

Check if Vulnerable:

Check kernel version and if running on LoongArch with KVM enabled: uname -r && grep -q LoongArch /proc/cpuinfo && lsmod | grep kvm

Check Version:

uname -r

Verify Fix Applied:

Verify kernel includes the fix commit: grep -q '5c68549c81bcca70fc464e305ffeefd9af968287' /proc/version_signature || echo 'Check kernel source/git log'

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages containing 'stack-protector: Kernel stack is corrupted in: send_ipi_data'
  • System crash/reboot events in system logs

Network Indicators:

  • None - this is a local kernel vulnerability

SIEM Query:

source="kernel" AND "stack-protector" AND "send_ipi_data"

🔗 References

📤 Share & Export