# CVE-2023-53846: f2fs: fix to do sanity check on direct node in truncate\_dnode()

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.22% (percentile 8, 2026-11-26)
- **Published:** 2025-12-09T01:30:09.202Z
- **Modified:** 2026-10-30T13:17:19.567Z

## Who should check

- Anyone running Linux \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< f5d46fc48b032b1e1c16f82862bf22b830fdb27b; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< af0f716ad3b039cab9d426da63a5ee6c88751185; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< a6ec83786ab9f13f25fb18166dee908845713a95
- Anyone running Linux 3.8

## Description

In the Linux kernel, the following vulnerability has been resolved:

f2fs: fix to do sanity check on direct node in truncate\_dnode()

syzbot reports below bug:

BUG: KASAN: slab-use-after-free in f2fs\_truncate\_data\_blocks\_range+0x122a/0x14c0 fs/f2fs/file.c:574
Read of size 4 at addr ffff88802a25c000 by task syz-executor148/5000

CPU: 1 PID: 5000 Comm: syz-executor148 Not tainted 6.4.0-rc7-syzkaller-00041-ge660abd551f1 \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0xd9/0x150 lib/dump\_stack.c:106
 print\_address\_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351
 print\_report mm/kasan/report.c:462 \[inline\]
 kasan\_report+0x11c/0x130 mm/kasan/report.c:572
 f2fs\_truncate\_data\_blocks\_range+0x122a/0x14c0 fs/f2fs/file.c:574
 truncate\_dnode+0x229/0x2e0 fs/f2fs/node.c:944
 f2fs\_truncate\_inode\_blocks+0x64b/0xde0 fs/f2fs/node.c:1154
 f2fs\_do\_truncate\_blocks+0x4ac/0xf30 fs/f2fs/file.c:721
 f2fs\_truncate\_blocks+0x7b/0x300 fs/f2fs/file.c:749
 f2fs\_truncate.part.0+0x4a5/0x630 fs/f2fs/file.c:799
 f2fs\_truncate include/linux/fs.h:825 \[inline\]
 f2fs\_setattr+0x1738/0x2090 fs/f2fs/file.c:1006
 notify\_change+0xb2c/0x1180 fs/attr.c:483
 do\_truncate+0x143/0x200 fs/open.c:66
 handle\_truncate fs/namei.c:3295 \[inline\]
 do\_open fs/namei.c:3640 \[inline\]
 path\_openat+0x2083/0x2750 fs/namei.c:3791
 do\_filp\_open+0x1ba/0x410 fs/namei.c:3818
 do\_sys\_openat2+0x16d/0x4c0 fs/open.c:1356
 do\_sys\_open fs/open.c:1372 \[inline\]
 \_\_do\_sys\_creat fs/open.c:1448 \[inline\]
 \_\_se\_sys\_creat fs/open.c:1442 \[inline\]
 \_\_x64\_sys\_creat+0xcd/0x120 fs/open.c:1442
 do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
 do\_syscall\_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

The root cause is, inodeA references inodeB via inodeB's ino, once inodeA
is truncated, it calls truncate\_dnode() to truncate data blocks in inodeB's
node page, it traverse mapping data from node-\>i.i\_addr\[0\] to
node-\>i.i\_addr\[ADDRS\_PER\_BLOCK() - 1\], result in out-of-boundary access.

This patch fixes to add sanity check on dnode page in truncate\_dnode(),
so that, it can help to avoid triggering such issue, and once it encounters
such issue, it will record newly introduced ERROR\_INVALID\_NODE\_REFERENCE
error into superblock, later fsck can detect such issue and try repairing.

Also, it removes f2fs\_truncate\_data\_blocks() for cleanup due to the
function has only one caller, and uses f2fs\_truncate\_data\_blocks\_range()
instead.

## Affected and fixed versions

- Linux: \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< f5d46fc48b032b1e1c16f82862bf22b830fdb27b; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< af0f716ad3b039cab9d426da63a5ee6c88751185; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< a6ec83786ab9f13f25fb18166dee908845713a95 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2023-53846.md
Affected: Linux >= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, < f5d46fc48b032b1e1c16f82862bf22b830fdb27b; >= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, < af0f716ad3b039cab9d426da63a5ee6c88751185; >= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, < a6ec83786ab9f13f25fb18166dee908845713a95; Linux 3.8
Fixed in: no fixed version listed yet

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-2023-53846 being exploited?

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

### How serious is CVE-2023-53846?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53846?

Linux \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< f5d46fc48b032b1e1c16f82862bf22b830fdb27b; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< af0f716ad3b039cab9d426da63a5ee6c88751185; \>= 98e4da8ca301e062d79ae168c67e56f3c3de3ce4, \< a6ec83786ab9f13f25fb18166dee908845713a95; Linux 3.8.

### Is there a fix for CVE-2023-53846?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-53846?

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

- other: <https://git.kernel.org/stable/c/f5d46fc48b032b1e1c16f82862bf22b830fdb27b>
- other: <https://git.kernel.org/stable/c/af0f716ad3b039cab9d426da63a5ee6c88751185>
- other: <https://git.kernel.org/stable/c/a6ec83786ab9f13f25fb18166dee908845713a95>

## 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-2023-53846>

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