CVE-2025-38652
NoneCVSS
—
EPSS
0.2%
Published
Aug 22, 2025
CISA due date
—
Cloudanix analysis
A flaw in the Linux kernel's handling of storage device names could prevent certain filesystems from mounting correctly until the software is updated.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- OS kernel
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Out-of-bounds memory access in f2fs when a device path exactly fills MAX_PATH_LEN without a trailing null byte, causing adjacent struct fields to be interpreted as path data and leading to incorrect device path parsing during mount.
Why it matters to the business
Filesystem mount failures or incorrect device handling on Linux systems using f2fs can interrupt storage operations and require manual intervention or reboots until systems are updated.
How an attack unfolds
An attacker supplies a device path argument of exactly MAX_PATH_LEN bytes (for example via mkfs.f2fs -c or mount) so that sbi->devs.path[] lacks a null terminator; subsequent fields are then treated as part of the path string, resulting in failed device discovery or malformed mount behavior.
How to fix it
Apply the upstream fix that reserves one additional byte for the path null terminator (commit dc0172c74bd9edaee7bea2ebb35f3dbd37a8ae80) and update affected Linux kernel packages or rebuild from the patched source; Chainguard openjdk-17-openj9 variants should be upgraded to 0.53.0-r0 or later.
How to confirm the fix worked
Verify the running kernel contains commit dc0172c74bd9edaee7bea2ebb35f3dbd37a8ae80, confirm MAX_PATH_LEN-sized paths now receive a terminating null byte, and test mount operations with boundary-length device paths.
Typical attack path
- Identify a target system using the f2fs filesystem
- Create a device path string whose length equals MAX_PATH_LEN
- Invoke mkfs.f2fs or mount with the crafted path via the -c option or equivalent
- Observe kernel log messages showing truncated or corrupted device path and mount failure
How to detect it
Search kernel logs (dmesg, journalctl) for F2FS mount messages that show truncated device paths ending in non-printable bytes or that report "Failed to find devices" immediately after a long path is supplied; correlate with process execution of mkfs.f2fs or mount containing unusually long path arguments.
What your security team should do
- Prioritize kernel updates on all systems using f2fs
- Add the fixed commit hash to patch-management and SBOM tracking
- Monitor kernel logs for F2FS mount failures referencing device paths
- Review any custom f2fs mount scripts that construct long device paths
The record
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to avoid out-of-boundary access in devs.path - touch /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - truncate -s $((1024*1024*1024)) \ /mnt/f2fs/012345678901234567890123456789012345678901234567890123 - touch /mnt/f2fs/file - truncate -s $((1024*1024*1024)) /mnt/f2fs/file - mkfs.f2fs /mnt/f2fs/012345678901234567890123456789012345678901234567890123 \ -c /mnt/f2fs/file - mount /mnt/f2fs/012345678901234567890123456789012345678901234567890123 \ /mnt/f2fs/loop [16937.192225] F2FS-fs (loop0): Mount Device [ 0]: /mnt/f2fs/012345678901234567890123456789012345678901234567890123\xff\x01, 511, 0 - 3ffff [16937.192268] F2FS-fs (loop0): Failed to find devices If device path length equals to MAX_PATH_LEN, sbi->devs.path[] may not end up w/ null character due to path array is fully filled, So accidently, fields locate after path[] may be treated as part of device path, result in parsing wrong device path. struct f2fs_dev_info { ... char path[MAX_PATH_LEN]; ... }; Let's add one byte space for sbi->devs.path[] to store null character of device path string.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | linux | 0 | No fix |
| Debian:12 | linux | 0 | No fix |
| Debian:13 | linux | 0 | No fix |
| Debian:14 | linux | 0 | No fix |
| Debian:14 | linux | 0 | 6.16.3-1 |
| Linux | Kernel | 4.10.0 | 5.4.297 |
| Mageia:9 | kernel | 0 | 6.6.105-1.mga9 |
| Mageia:9 | kernel-linus | 0 | 6.6.105-1.mga9 |
| Mageia:9 | kmod-virtualbox | 0 | 7.1.10-10.mga9 |
| Mageia:9 | kmod-xtables-addons | 0 | 3.24-86.mga9 |
| Mageia:9 | mageia-repos | 0 | 9-4.mga9 |
| Mageia:9 | meta-task | 0 | 9-4.mga9 |
| openSUSE:Tumbleweed | kernel-source | 0 | 6.16.5-1.1 |
Related vulnerabilities
- CVE-2025-39885 In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix recursive… Also affects linux
- CVE-2025-39883 In the Linux kernel, the following vulnerability has been resolved: mm/memory-failure… Also affects linux
- CVE-2025-39876 In the Linux kernel, the following vulnerability has been resolved: net: fec: Fix… Also affects linux
- CVE-2025-39869 In the Linux kernel, the following vulnerability has been resolved: dmaengine: ti: edma… Also affects linux
- CVE-2025-39873 In the Linux kernel, the following vulnerability has been resolved: can: xilinx_can… Also affects linux
- CVE-2025-39863 In the Linux kernel, the following vulnerability has been resolved: wifi: brcmfmac: fix… Also affects linux
- CVE-2025-39865 In the Linux kernel, the following vulnerability has been resolved: tee: fix NULL pointer… Also affects linux
- CVE-2025-39866 In the Linux kernel, the following vulnerability has been resolved: fs: writeback: fix… Also affects linux