CVE-2026-31702
Use-After-Free in Linux Kernel F2FS
Publication date: 2026-05-01
Last updated on: 2026-05-06
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | From 6.7 (inc) to 6.12.84 (exc) |
| linux | linux_kernel | 7.1 |
| linux | linux_kernel | 7.1 |
| linux | linux_kernel | From 6.13 (inc) to 6.18.25 (exc) |
| linux | linux_kernel | From 6.19 (inc) to 7.0.2 (exc) |
| linux | linux_kernel | From 5.6 (inc) to 6.6.136 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-416 | The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. |
Attack-Flow Graph
AI Powered Q&A
How can this vulnerability impact me? :
This vulnerability can lead to a use-after-free condition in the kernel, which may cause system instability, crashes, or potentially allow an attacker to execute arbitrary code with kernel privileges.
Because it involves memory being accessed after it has been freed, it could be exploited to corrupt memory or escalate privileges, impacting system security and reliability.
What immediate steps should I take to mitigate this vulnerability?
This vulnerability is resolved by a fix in the Linux kernel that changes the order of operations in the f2fs_compress_write_end_io() function to prevent use-after-free conditions.
To mitigate this vulnerability immediately, you should update your Linux kernel to a version that includes this fix for the f2fs filesystem.
Can you explain this vulnerability to me?
This vulnerability is a use-after-free bug in the Linux kernel's F2FS filesystem, specifically in the function f2fs_compress_write_end_io().
The issue occurs because a counter (F2FS_WB_CP_DATA) can reach zero during a concurrent unmount operation, which unblocks the unmount process. The unmount then destroys a memory cache (page_array_slab) and frees the associated structure (sbi). However, a bio completion callback is still running and tries to access this now freed memory, causing a use-after-free error.
The fix involves reordering operations so that the decrement of the counter happens only after the memory is no longer accessed, preventing the use-after-free condition.