CVE-2025-40054
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 a Use-After-Free (UAF) issue in the Linux kernel's f2fs file system, specifically in the function f2fs_merge_page_bio(). It occurs due to a race condition where a bounced page (encrypted_page) can be freed before it is accessed again, leading to a kernel NULL pointer dereference and potential system crash (kernel panic). The problem arises when multiple write operations interact with the bio list and page cache in a way that causes the freed page to be accessed afterward.
How can this vulnerability impact me? :
This vulnerability can cause a kernel panic, leading to system crashes or instability. Since it involves a Use-After-Free condition in the kernel, it could potentially be exploited to cause denial of service by crashing the system. It may also affect data integrity during write operations on the f2fs file system.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by observing kernel panic logs related to the f2fs filesystem, specifically errors involving NULL pointer dereference in f2fs_merge_page_bio(). You can monitor kernel logs using commands like 'dmesg' or 'journalctl -k' to look for crash traces similar to those described. Additionally, running the provided testcase scripts that repeatedly perform pwrite and fdatasync operations on an f2fs encrypted file can reproduce the issue, which can help in detection. Example commands to reproduce the issue are: In shell #1: for ((i=1;i>0;i++)) do xfs_io -f /mnt/f2fs/enc/file -c "pwrite 0 32k" -c "fdatasync"; done In shell #2: for ((i=1;i>0;i++)) do xfs_io -f /mnt/f2fs/enc/file -c "pwrite 0 32k" -c "fdatasync"; done
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability immediately, avoid using the affected f2fs filesystem or disable features that trigger the vulnerable code path until a patched kernel version is applied. Applying the kernel update that fixes the use-after-free issue in f2fs_merge_page_bio() is the definitive fix. If updating is not immediately possible, refrain from running workloads that perform concurrent pwrite and fdatasync operations on encrypted files in f2fs, as demonstrated by the testcase, to reduce the risk of triggering the vulnerability.