Cloudanix VulnDB

CVE-2025-38627

High · 7.8

CVSS

7.8

EPSS

0.2%

Published

Aug 22, 2025

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A bug in how Linux handles certain compressed files can let someone with access to the machine crash it or take control.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Full Compromise
Component
OS kernel
Class
Use After Free
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

Use-after-free in f2fs compression path where decompress_io_ctx holds a reference to f2fs_inode_info that can be freed via RCU after file unlink and before post_read_wq worker executes f2fs_free_dic, allowing dereference of freed inode fields such as i_compress_algorithm.

Why it matters to the business

Local attackers on Linux systems using f2fs with compression enabled can trigger kernel memory corruption, leading to crashes, privilege escalation, or arbitrary code execution; high workload systems increase exposure window and operational risk of denial of service.

How an attack unfolds

An attacker performs a concurrent read that triggers asynchronous decompression, immediately unlinks the file to queue inode eviction via RCU, then relies on the delayed post_read_wq worker to dereference the now-freed inode inside f2fs_free_dic, achieving UAF read or write.

How to fix it

Update Linux kernel to commit 5d604d40cd3232b09cb339941ef958e49283ed0a or later; for Chainguard packages update openjdk-17-openj9 and related variants to 0.53.0-r0 or newer; disable f2fs compression where not required as a temporary mitigation.

How to confirm the fix worked

Verify kernel source contains the stored compress_algorithm and sbi fields in decompress_io_ctx; confirm package versions match the listed fixed releases; test by exercising concurrent read+unlink workloads under load and checking for absence of UAF reports in dmesg or kmemleak.

Typical attack path

  1. Open file on f2fs with compression enabled and issue read that schedules post_read_wq work
  2. Immediately unlink or delete the file to trigger iput, evict, and call_rcu for inode freeing
  3. Force high system load to delay kworker execution of f2fs_late_free_dic
  4. RCU grace period expires and f2fs_free_inode releases the inode memory
  5. Scheduled worker runs f2fs_free_dic and reads from now-freed inode structure

How to detect it

Monitor kernel logs for f2fs UAF warnings or oops involving f2fs_free_dic or f2fs_release_decomp_mem; inspect post_read_wq activity combined with rapid unlink operations on compressed f2fs files; review audit logs for sequences of read followed immediately by unlink under high CPU load.

What your security team should do

  • Prioritize patching production systems using f2fs compression within 30 days given the local privilege-escalation potential
  • Audit workloads for f2fs mount options with compression enabled and schedule upgrades using the exact fixed commits or package versions
  • Add kernel memory-safety monitoring (e.g., KASAN) in test environments to validate the fix before rollout
  • Consider filesystem migration or compression disablement for high-risk legacy kernels that cannot be updated promptly

The record

In the Linux kernel, the following vulnerability has been resolved: f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic The decompress_io_ctx may be released asynchronously after I/O completion. If this file is deleted immediately after read, and the kworker of processing post_read_wq has not been executed yet due to high workloads, It is possible that the inode(f2fs_inode_info) is evicted and freed before it is used f2fs_free_dic. The UAF case as below: Thread A Thread B - f2fs_decompress_end_io - f2fs_put_dic - queue_work add free_dic work to post_read_wq - do_unlink - iput - evict - call_rcu This file is deleted after read. Thread C kworker to process post_read_wq - rcu_do_batch - f2fs_free_inode - kmem_cache_free inode is freed by rcu - process_scheduled_works - f2fs_late_free_dic - f2fs_free_dic - f2fs_release_decomp_mem read (dic->inode)->i_compress_algorithm This patch store compress_algorithm and sbi in dic to avoid inode UAF. In addition, the previous solution is deprecated in [1] may cause system hang. [1] https://lore.kernel.org/all/c36ab955-c8db-4a8b-a9d0-f07b5f426c3f@kernel.org

Affected packages

Ecosystem Package Introduced Fixed
Chainguard hyperv-daemons-6.12 0 6.12.60-r2
Chainguard linux-aws-6.12-boot-installed 0 6.12.58-r0
Chainguard linux-aws-6.12-fips-boot-installed 0 6.12.58-r0
Chainguard linux-aws-6.12-headers 0 6.12.60-r1
Chainguard linux-aws-6.12-modules 0 6.12.58-r0
Chainguard linux-azure-6.12 0 6.12.68-r0
Chainguard linux-azure-6.12-boot-installed 0 6.12.60-r0
Chainguard linux-azure-6.12-fips-boot-installed 0 6.12.60-r1
Chainguard linux-azure-6.12-headers 0 6.12.60-r2
Chainguard linux-azure-6.12-modules 0 6.12.58-r1
Chainguard linux-gcp-6.12-boot-installed 0 6.12.58-r0
Chainguard linux-gcp-6.12-fips-boot-installed 0 6.12.58-r0
Chainguard linux-gcp-6.12-headers 0 6.12.58-r0
Chainguard linux-gcp-6.12-modules 0 6.12.58-r0
Chainguard linux-qemu-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-headers 0 6.12.63-r0
Chainguard linux-qemu-6.12-modules 0 6.12.63-r0
Chainguard linux-vmware-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-headers 0 6.12.63-r0
Chainguard linux-vmware-6.12-modules 0 6.12.63-r0
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 6.0.0 6.16.1
Linux Kernel 6.0.0 6.6.118

Related vulnerabilities