CVE-2025-38221
BaseFortify
Publication date: 2025-07-04
Last updated on: 2025-11-18
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-125 | The product reads data past the end, or before the beginning, of the intended buffer. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability in the Linux kernel's ext4 filesystem occurs when a hole punching operation is attempted with a start offset that exceeds the maximum allowed end offset (max_end). This leads to a negative length calculation in the truncate_inode_partial_folio() function during page cache truncation, which can cause kernel crashes (BUG) and invalid opcode errors. The issue arises because the kernel does not properly filter out invalid punch offsets, resulting in undesirable consequences such as system instability.
How can this vulnerability impact me? :
This vulnerability can cause the Linux kernel to crash or become unstable when certain file operations involving hole punching with invalid offsets are performed. This can lead to system crashes (kernel BUGs), potentially causing data loss, service interruptions, or denial of service on affected systems.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by attempting to reproduce the conditions that trigger the kernel bug, specifically by using commands that punch a hole with a start offset exceeding max_end on an ext4 filesystem. The example commands to detect this issue are: truncate -s 9895604649994 /mnt/foo xfs_io -c "pwrite 8796093022208 4096" /mnt/foo xfs_io -c "fpunch 8796093022213 25769803777" /mnt/foo If these commands cause a kernel BUG or Oops, it indicates the presence of the vulnerability.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves applying the patch that fixes the vulnerability by filtering out cases where the punching start offset exceeds max_end. Until the patch is applied, avoid using fallocate or punch hole operations with offsets that could exceed the maximum allowed range on ext4 filesystems to prevent triggering the bug.