# CVE-2022-50009: f2fs: fix null-ptr-deref in f2fs\_get\_dnode\_of\_data

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.27% (percentile 13, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-06-18T11:01:14.219Z
- **Modified:** 2026-08-15T13:17:29.753Z

## Who should check

- Anyone running Linux \>= 6db52f1944417c2601182a591a704e2f119c5215, \< 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 7000ad53ec1b17bd2fac76984b7b0c663755cbb7; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4
- Anyone running Linux 5.19

## Description

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")

## Affected and fixed versions

- Linux: \>= 6db52f1944417c2601182a591a704e2f119c5215, \< 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 7000ad53ec1b17bd2fac76984b7b0c663755cbb7; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

- Upgrade Linux to 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50009. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50009.md
Affected: Linux >= 6db52f1944417c2601182a591a704e2f119c5215, < 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e; >= 3db1de0e582c358dd013f3703cd55b5fe4076436, < 7000ad53ec1b17bd2fac76984b7b0c663755cbb7; >= 3db1de0e582c358dd013f3703cd55b5fe4076436, < 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4; Linux 5.19
Fixed in: Linux 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e, Linux 7000ad53ec1b17bd2fac76984b7b0c663755cbb7, Linux 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50009 being exploited?

There is no confirmed exploitation: CVE-2022-50009 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.27% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50009?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50009?

Linux \>= 6db52f1944417c2601182a591a704e2f119c5215, \< 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 7000ad53ec1b17bd2fac76984b7b0c663755cbb7; \>= 3db1de0e582c358dd013f3703cd55b5fe4076436, \< 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4; Linux 5.19.

### Is there a fix for CVE-2022-50009?

Yes. Fixed in Linux 0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e, Linux 7000ad53ec1b17bd2fac76984b7b0c663755cbb7, Linux 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4. Upgrade Linux to 4a2c5b7994960fac29cf8a3f4e62855bae1b27d4 or later.

### How do I check if I'm affected by CVE-2022-50009?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/0f63e33eca6fa29a11c76fa31db5fe1cada5ad6e>
- patch: <https://git.kernel.org/stable/c/7000ad53ec1b17bd2fac76984b7b0c663755cbb7>
- patch: <https://git.kernel.org/stable/c/4a2c5b7994960fac29cf8a3f4e62855bae1b27d4>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50009>

HTML: <https://flawdb.com/CVE-2022-50009> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50009>
