CVE-2022-50009: f2fs: fix null-ptr-deref in f2fs_get_dnode_of_data
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix null-ptr-deref in f2fs_get_dnode_of_data
There is issue as follows when test f2fs atomic write:
F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock
F2FS-fs (loop0): invalid crc_offset: 0
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix.
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix.
==================================================================
BUG: KASAN: null-ptr-deref in f2fs_get_dnode_of_data+0xac/0x16d0
Read of size 8 at addr 0000000000000028 by task rep/1990
CPU: 4 PID: 1990 Comm: rep Not tainted 5.19.0-rc6-next-20220715 #266
Call Trace:
<TASK>
dump_stack_lvl+0x6e/0x91
print_report.cold+0x49a/0x6bb
kasan_report+0xa8/0x130
f2fs_get_dnode_of_data+0xac/0x16d0
f2fs_do_write_data_page+0x2a5/0x1030
move_data_page+0x3c5/0xdf0
do_garbage_collect+0x2015/0x36c0
f2fs_gc+0x554/0x1d30
f2fs_balance_fs+0x7f5/0xda0
f2fs_write_single_data_page+0xb66/0xdc0
f2fs_write_cache_pages+0x716/0x1420
f2fs_write_data_pages+0x84f/0x9a0
do_writepages+0x130/0x3a0
filemap_fdatawrite_wbc+0x87/0xa0
file_write_and_wait_range+0x157/0x1c0
f2fs_do_sync_file+0x206/0x12d0
f2fs_sync_file+0x99/0xc0
vfs_fsync_range+0x75/0x140
f2fs_file_write_iter+0xd7b/0x1850
vfs_write+0x645/0x780
ksys_write+0xf1/0x1e0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x63/0xcd
As 3db1de0e582c commit changed atomic write way which new a cow_inode for
atomic write file, and also mark cow_inode as FI_ATOMIC_FILE.
When f2fs_do_write_data_page write cow_inode will use cow_inode's cow_inode
which is NULL. Then will trigger null-ptr-deref.
To solve above issue, introduce FI_COW_FILE flag for COW inode.
Fiexes: 3db1de0e582c("f2fs: change the current atomic write way")
Security readout for executives and security teams
Plain-English summary
CVE-2022-50009 is a Linux kernel F2FS filesystem bug that can trigger a null pointer dereference during atomic write handling. The practical concern is availability: affected systems using F2FS may hit a kernel fault under the described write and garbage-collection path.
Executive priority
Treat as a targeted availability risk for F2FS-dependent Linux systems. It is not currently supported by provided evidence as internet-exploited or remotely exploitable, so prioritize patching based on F2FS usage and uptime requirements.
Technical view
The bug is in f2fs_get_dnode_of_data. A prior atomic-write change created a COW inode and marked it as FI_ATOMIC_FILE, causing writeback to reference a NULL cow_inode. The upstream resolution introduces FI_COW_FILE for COW inodes.
Likely exposure
Exposure is most likely on Linux systems using F2FS, particularly where atomic write behavior is exercised. The source does not identify affected distributions, cloud images, appliances, or remote attack surfaces.
Exploitation context
CISA KEV status is false in the source bundle, and no cited source states active exploitation. The report shows a KASAN null-ptr-deref during testing, not a public exploitation claim.
Researcher notes
Evidence is narrow and kernel-specific. The source describes a resolved null-ptr-deref in the F2FS atomic-write COW inode path and provides upstream stable commits, but no CVSS, CWE, exploitability analysis, or distro mapping.
Mitigation direction
Check vendor kernel guidance for CVE-2022-50009.
Update to a kernel package containing the referenced F2FS stable fixes.
Prioritize systems that mount or rely on F2FS volumes.
Restrict untrusted F2FS media or mounts where operationally feasible.
Monitor kernel logs for F2FS null pointer dereference crashes.
Validation and detection
Inventory Linux hosts and appliances using F2FS.
Map running kernel builds to vendor advisories or stable commits.
Review logs for f2fs_get_dnode_of_data or F2FS writeback crashes.
Confirm patched kernels include the FI_COW_FILE fix.
Avoid production reproduction; validate only in controlled lab systems.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2022-50009 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
4Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Jun 18, 2025, 11:01 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.