CVE-2026-31715
Received Received - Intake
Use-After-Free in F2FS Linux Kernel

Publication date: 2026-05-01

Last updated on: 2026-05-01

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io() The xfstests case "generic/107" and syzbot have both reported a NULL pointer dereference. The concurrent scenario that triggers the panic is as follows: F2FS_WB_CP_DATA write callback umount - f2fs_write_checkpoint - f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA) - blk_mq_end_request - bio_endio - f2fs_write_end_io : dec_page_count(sbi, F2FS_WB_CP_DATA) : wake_up(&sbi->cp_wait) - kill_f2fs_super - kill_block_super - f2fs_put_super : iput(sbi->node_inode) : sbi->node_inode = NULL : f2fs_in_warm_node_list - is_node_folio // sbi->node_inode is NULL and panic The root cause is that f2fs_put_super() calls iput(sbi->node_inode) and sets sbi->node_inode to NULL after sbi->nr_pages[F2FS_WB_CP_DATA] is decremented to zero. As a result, f2fs_in_warm_node_list() may dereference a NULL node_inode when checking whether a folio belongs to the node inode, leading to a panic. This patch fixes the issue by calling f2fs_in_warm_node_list() before decrementing sbi->nr_pages[F2FS_WB_CP_DATA], thus preventing the use-after-free condition.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-01
Last Modified
2026-05-01
Generated
2026-05-07
AI Q&A
2026-05-01
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
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 filesystem. It occurs because the function f2fs_put_super() calls iput() on sbi->node_inode and then sets sbi->node_inode to NULL after decrementing sbi->nr_pages[F2FS_WB_CP_DATA] to zero. Subsequently, the function f2fs_in_warm_node_list() may attempt to dereference this now NULL node_inode pointer, leading to a kernel panic.

The problem arises in a concurrent scenario involving write callbacks and unmount operations, where the order of operations causes the use-after-free condition. The fix involves changing the order of operations by calling f2fs_in_warm_node_list() before decrementing sbi->nr_pages[F2FS_WB_CP_DATA], preventing the NULL pointer dereference.


How can this vulnerability impact me? :

This vulnerability can cause the Linux kernel to panic due to a NULL pointer dereference, leading to a system crash. Such a crash can result in denial of service, data loss, or system instability, especially on systems using the f2fs filesystem.


What immediate steps should I take to mitigate this vulnerability?

The vulnerability is fixed by a patch that changes the order of operations in the f2fs filesystem code to prevent a use-after-free condition. Immediate mitigation involves updating the Linux kernel to a version that includes this fix.

  • Apply the patch or upgrade to a Linux kernel version released after 2026-05-01 that contains the fix for the f2fs use-after-free issue.
  • Avoid unmounting f2fs filesystems during heavy write operations until the fix is applied, as the panic occurs during concurrent write and unmount operations.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart