CVE-2025-38221

7.1 HIGH

📋 TL;DR

This CVE-2025-38221 is an out-of-bounds vulnerability in the Linux kernel's ext4 filesystem that occurs when punching holes with invalid offsets. It can cause kernel crashes (denial of service) and potentially lead to data corruption. Any system using the affected Linux kernel versions with ext4 filesystems is vulnerable.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Specific versions not explicitly stated in CVE, but references indicate fixes in stable kernel trees. Likely affects multiple recent kernel versions before fixes.
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires ext4 filesystem usage and specific file operations (truncate/punch hole) with malformed parameters.

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

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel panic leading to system crash and denial of service, with potential data corruption or loss on affected filesystems.

🟠

Likely Case

System crash/denial of service when specific file operations are performed on ext4 filesystems with malformed parameters.

🟢

If Mitigated

No impact if the vulnerability is patched or if the specific file operations aren't performed.

🌐 Internet-Facing: LOW - Requires local filesystem access and specific file operations, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Local users or processes with filesystem write access could crash the system, affecting availability.

🎯 Exploit Status

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

Exploitation requires local access and ability to perform specific filesystem operations. The provided reproducer shows how to trigger the crash.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in kernel commits: 28b62cb58fd014338f5004170f2e3a35bf0af238, a4d60ba277ecd8a98c5a593cbc0ef2237c20a541, b5e58bcd79625423487fa3ecba8e8411b5396327

Vendor Advisory: https://git.kernel.org/stable/c/28b62cb58fd014338f5004170f2e3a35bf0af238

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing the fix commits. 2. Check your distribution's security advisories for specific patched kernel versions. 3. Reboot system after kernel update.

🔧 Temporary Workarounds

Restrict filesystem operations

linux

Limit users' ability to perform truncate and hole punching operations on critical ext4 filesystems.

Use filesystem ACLs or mount options to restrict write operations
Implement mandatory access controls (SELinux/AppArmor) to limit file operations

🧯 If You Can't Patch

  • Monitor for crash reports related to ext4 filesystem operations
  • Restrict user access to perform advanced filesystem operations on production systems

🔍 How to Verify

Check if Vulnerable:

Check kernel version and compare with distribution's security advisories. The vulnerability can be tested by attempting the reproducer commands on a test system.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version includes the fix commits or check with distribution's security update verification tools.

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic/Oops messages mentioning ext4_punch_hole, truncate_inode_partial_folio, or zero_user_segments
  • System crash logs following filesystem operations

Network Indicators:

  • None - this is a local filesystem vulnerability

SIEM Query:

Search for kernel panic events or system crash reports with ext4-related function names in call traces

🔗 References

📤 Share & Export