CVE-2025-21866

5.5 MEDIUM

📋 TL;DR

A memory management vulnerability in the Linux kernel's PowerPC code patching subsystem incorrectly marks a text patching area as VM_ALLOC when it's not vmalloc memory. This causes KASAN (Kernel Address Sanitizer) to incorrectly flag valid memory accesses as out-of-bounds writes. Affects PowerPC systems running vulnerable Linux kernel versions with KASAN enabled.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Kernel versions before the fix commits (specific versions vary by distribution)
Operating Systems: Linux distributions running on PowerPC architecture
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when KASAN is enabled and running on PowerPC architecture. The vulnerability was introduced by commit e4137f08816b and affects systems using the text patching infrastructure.

📦 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 or system crash due to KASAN incorrectly detecting out-of-bounds memory writes, leading to denial of service.

🟠

Likely Case

System boot failures or crashes on PowerPC systems with KASAN enabled, particularly during BPF JIT compilation or text patching operations.

🟢

If Mitigated

No impact on systems without KASAN enabled or on non-PowerPC architectures.

🌐 Internet-Facing: LOW - Requires local access and specific kernel configuration.
🏢 Internal Only: MEDIUM - Could affect PowerPC servers or embedded systems with KASAN enabled in production.

🎯 Exploit Status

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

This is a kernel configuration issue that causes false positive KASAN reports rather than a traditional security vulnerability. Exploitation would require triggering specific kernel code paths with KASAN enabled.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in kernel commits: 2d542f13d26344e3452eee77613026ce9b653065, 2e6c80423f201405fd65254e52decd21663896f3, 6847b3e40bb963e57b61d1cc6fe84cb37b9d3d4c, 8d06e9208184b2851fa79a3a39d6860320c8bdf8, 97de5852058a299ba447cd9782fe96488d30108b

Vendor Advisory: https://git.kernel.org/stable/c/2d542f13d26344e3452eee77613026ce9b653065

Restart Required: Yes

Instructions:

1. Update to a kernel version containing the fix commits. 2. For distributions: Apply vendor kernel updates. 3. Rebuild kernel if compiling from source. 4. Reboot system to load patched kernel.

🔧 Temporary Workarounds

Disable KASAN

linux

Disable Kernel Address Sanitizer to prevent false positive reports

Rebuild kernel with CONFIG_KASAN=n or boot with 'kasan=off' kernel parameter

Avoid PowerPC text patching

linux

Disable features that trigger text patching (like BPF JIT)

echo 0 > /proc/sys/net/core/bpf_jit_enable

🧯 If You Can't Patch

  • Disable KASAN in kernel configuration
  • Avoid using BPF JIT compilation on affected PowerPC systems
  • Monitor system logs for KASAN reports and restart affected services

🔍 How to Verify

Check if Vulnerable:

Check if system is PowerPC architecture with KASAN enabled and kernel version before fix commits: 'uname -m' and 'cat /proc/cmdline | grep kasan'

Check Version:

uname -r

Verify Fix Applied:

Check kernel version includes fix commits: 'uname -r' and verify with distribution patch notes

📡 Detection & Monitoring

Log Indicators:

  • KASAN reports of vmalloc-out-of-bounds in copy_to_kernel_nofault
  • Kernel panic messages related to text patching or BPF JIT

SIEM Query:

kernel_log: "KASAN: vmalloc-out-of-bounds" OR "copy_to_kernel_nofault" OR "text_area_cpu_up"

🔗 References

📤 Share & Export