CVE-2025-38652 f2fs: fix to avoid out-of-boundary access in devs.path
A local attacker can cause an out-of-bounds read in the Linux kernel f2fs filesystem by mounting a crafted image with a long device path, leading to a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-38652?
CVE-2025-38652 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 22 Aug 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-125
Which versions are affected by CVE-2025-38652?
It affects 2 products.
Linux distribution packages (1)
kernel-source openSUSE:Tumbleweed | All versions | 6.16.5-1.1 |
Products include Debian Debian Linux, Linux kernel.
How do I fix CVE-2025-38652?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2025-38652 being exploited?
There is no known exploitation of CVE-2025-38652 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as AZL-66596, BELL-CVE-2025-38652, DEBIAN-CVE-2025-38652, GHSA-x5pr-3426-w9ph, ROOT-OS-DEBIAN-11-CVE-2025-38652, ROOT-OS-DEBIAN-12-CVE-2025-38652 and 5 more.