In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to pass folio->index to f2fs_sanity_check_node_footer()
Otherwise in f2fs_sanity_check_node_footer(), it will check the
same nid incorrectly.
CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8
AV:L - The defect is in f2fs __write_node_folio() on the node-mapping writeback path, reached only from local VFS operations (fsync, write, checkpoint, GC, or reclaim) on a mounted f2fs volume; no network protocol (ksmbd/nfsd/packet) processes this node-footer check.
AC:L - A crafted f2fs image fully controls the on-disk node footer nid. Related syzbot reports show that async node readahead of a fuzzed image followed by writeback deterministically hits the mismatched-nid case, with no race or layout the attacker cannot arrange.
PR:L - Mounting f2fs requires privilege (no FS_USERNS_MOUNT), but once the volume is mounted—Android userdata, automounted SD/USB, or a shared workstation—any unprivileged local user can dirty node pages via write/fsync/fallocate/truncate and enter __write_node_folio with no capability check.
UI:N - After the crafted image is mounted, the attacker triggers node writeback themselves through ordinary file syscalls or in-kernel checkpoint/reclaim; no separate victim action such as opening a file or confirming a prompt is required.
S:U - The impact is kernel memory and f2fs metadata corruption on the host that mounted the volume; it does not cross a VM, IOMMU, or guest-to-host security boundary.
C:H - __write_node_folio uses the attacker-controlled footer nid as the NAT key without a range check, so current_nat_addr() indexes nat_bitmap at an attacker-chosen offset (nid/NAT_ENTRY_PER_BLOCK), an unbounded out-of-bounds kernel read. The same nid confusion later parses the planted node with the wrong layout, leaking adjacent folio contents as in CVE-2025-40025.
I:H - set_node_addr() and f2fs_do_write_node_page() commit the node folio under the footer nid, overwriting an arbitrary NAT entry and remapping any node. Subsequent operations on that nid write through the wrong inode-vs-dnode layout, producing out-of-bounds metadata writes past the node folio.
A:H - A mismatched nid that fails f2fs_get_node_info() takes redirty_out, looping writepages indefinitely (the hang this check was added to stop). A nid that proceeds hits f2fs_bug_on() in set_node_addr()/write_end_io, panicking with CONFIG_F2FS_CHECK_FS or WARNing and corrupting the filesystem otherwise.
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The defect is in f2fs __write_node_folio() on the node-mapping writeback path, reached only from local VFS operations (fsync, write, checkpoint, GC, or reclaim) on a mounted f2fs volume; no network protocol (ksmbd/nfsd/packet) processes this node-footer check.
AC:L - A crafted f2fs image fully controls the on-disk node footer nid. Related syzbot reports show that async node readahead of a fuzzed image followed by writeback deterministically hits the mismatched-nid case, with no race or layout the attacker cannot arrange.
PR:L - Mounting f2fs requires privilege (no FS_USERNS_MOUNT), but once the volume is mounted—Android userdata, automounted SD/USB, or a shared workstation—any unprivileged local user can dirty node pages via write/fsync/fallocate/truncate and enter __write_node_folio with no capability check.
UI:N - After the crafted image is mounted, the attacker triggers node writeback themselves through ordinary file syscalls or in-kernel checkpoint/reclaim; no separate victim action such as opening a file or confirming a prompt is required.
S:U - The impact is kernel memory and f2fs metadata corruption on the host that mounted the volume; it does not cross a VM, IOMMU, or guest-to-host security boundary.
C:H - __write_node_folio uses the attacker-controlled footer nid as the NAT key without a range check, so current_nat_addr() indexes nat_bitmap at an attacker-chosen offset (nid/NAT_ENTRY_PER_BLOCK), an unbounded out-of-bounds kernel read. The same nid confusion later parses the planted node with the wrong layout, leaking adjacent folio contents as in CVE-2025-40025.
I:H - set_node_addr() and f2fs_do_write_node_page() commit the node folio under the footer nid, overwriting an arbitrary NAT entry and remapping any node. Subsequent operations on that nid write through the wrong inode-vs-dnode layout, producing out-of-bounds metadata writes past the node folio.
A:H - A mismatched nid that fails f2fs_get_node_info() takes redirty_out, looping writepages indefinitely (the hang this check was added to stop). A nid that proceeds hits f2fs_bug_on() in set_node_addr()/write_end_io, panicking with CONFIG_F2FS_CHECK_FS or WARNing and corrupting the filesystem otherwise.
CVSS 3.1