Junglewise Threat Intelligence

CVE-2025-38627: Linux Kernel F2FS use-after-free in f2fs_free_dic

CVE-2025-38627 · Severity: high · CVSS 7.8 · Published 2025-08-22

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability was identified in the Linux kernel's Flash-Friendly File System (F2FS) that could allow a local user to crash the system or potentially execute unauthorized actions. The issue occurs when a compressed file is read and then immediately deleted, causing the system to try and access data that has already been cleared from memory. This flaw primarily impacts system stability and data integrity on devices using F2FS, such as many Android smartphones and flash-based storage systems.

Technical details

A use-after-free (UAF) vulnerability exists in the F2FS file system's compression implementation, specifically within the 'f2fs_free_dic' function. The root cause is a race condition where the 'decompress_io_ctx' is released asynchronously after I/O completion; if a file is deleted immediately after a read operation under high workload, the 'f2fs_inode_info' may be evicted and freed before the background kworker ('post_read_wq') can process the decompression context. An attacker with local access could exploit this race condition to trigger a kernel crash or potentially achieve privilege escalation. The fix involves storing the 'compress_algorithm' and 'sbi' directly in the decompression context ('dic') to avoid referencing the potentially freed inode.

Affected products

  • Linux Linux Kernel 6.0 to 6.16.1

Timeline

  • 2025-08-22: advisory: Initial disclosure and publication
  • 2025-08-22: patched: Fixes merged into stable branches

References