CVE-2025-40025
BaseFortify
Publication date: 2025-10-28
Last updated on: 2025-10-30
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is in the Linux kernel's f2fs filesystem. It occurs because a non-inode dnode can have the same footer inode number and node ID as an inode, causing the system to misinterpret the dnode as an inode. This leads to incorrect calculations of block addresses and eventually triggers a kernel panic due to an invalid truncation range. The issue was fixed by introducing a new node type to properly check and detect such corruptions in the node footer.
How can this vulnerability impact me? :
This vulnerability can cause the Linux kernel to panic when handling certain f2fs filesystem operations, leading to system crashes or instability. This can result in denial of service, data loss, or corruption if the filesystem becomes unusable or unstable during normal operations involving file truncation or hole punching.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by observing kernel panics or BUG messages related to f2fs, specifically at fs/f2fs/file.c:1243, indicating an invalid opcode or panic triggered by inconsistent truncation range in f2fs_truncate_hole(). You can try to reproduce the issue using the following commands: mkfs.f2fs -f /dev/vdb mount /dev/vdb /mnt/f2fs touch /mnt/f2fs/foo touch /mnt/f2fs/bar dd if=/dev/zero of=/mnt/f2fs/foo bs=1M count=8 umount /mnt/f2fs inject.f2fs --node --mb i_nid --nid 4 --idx 0 --val 5 /dev/vdb mount /dev/vdb /mnt/f2fs xfs_io /mnt/f2fs/foo -c "fpunch 6984k 4k" Monitoring kernel logs (e.g., dmesg) for such BUG messages can help detect the vulnerability.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version that includes the patch fixing this vulnerability, which introduces a new node_type NODE_TYPE_NON_INODE and performs sanity checks on node footers to prevent panic. Until the patch is applied, avoid using f2fs with potentially corrupted images or performing operations that trigger the vulnerability, such as fallocate or punch hole on f2fs filesystems created with untrusted or fuzzed images.