CVE-2026-99584: f2fs: fix to avoid folio->mapping dereference in is_{meta, node}_folio()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid folio->mapping dereference in is_{meta, node}_folio()
Otherwise, it may cause NULL pointer dereference in race condition:
Thread A Thread B
- f2fs_setattr
- f2fs_truncate
- f2fs_truncate_blocks
- f2fs_do_truncate_blocks
- f2fs_truncate_inode_blocks
- truncate_dnode
- truncate_node
- invalidate_mapping_pages
- folio->mapping = NULL
- folio_lock
- is_node_folio
- F2FS_F_SB(folio): dereference on folio->mapping
The Linux kernel CVE team has assigned CVE-2026-99584 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.16 with commit 019a8912425e231511042a4eae48b7a9e459453c and fixed in 6.18.64 with commit ecf2796547582f1518f36bba370904934e659a46 Issue introduced in 6.16 with commit 019a8912425e231511042a4eae48b7a9e459453c and fixed in 7.3.5 with commit f56399666631be3d755a16fa9658e088d81c99b7 Issue introduced in 6.16 with commit 019a8912425e231511042a4eae48b7a9e459453c and fixed in 7.4-rc1 with commit b5a71253c5c7e1139eab2f3e1e13e0bf2cbcaac7
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99584
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/f2fs/checkpoint.c fs/f2fs/data.c fs/f2fs/f2fs.h fs/f2fs/gc.c fs/f2fs/node.c fs/f2fs/segment.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/ecf2796547582f1518f36bba370904934e659a46 https://git.kernel.org/stable/c/f56399666631be3d755a16fa9658e088d81c99b7 https://git.kernel.org/stable/c/b5a71253c5c7e1139eab2f3e1e13e0bf2cbcaac7