Look up another CVE · open CVE-2023-53846 in the interactive tracker
CVE-2023-53846
f2fs: fix to do sanity check on direct node in truncate_dnode()
Published 2025-12-09 (10 months ago) by the Linux kernel CNA. Subsystem fs/f2fs. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2023-53846 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.4.11-1 | Update the kernel and reboot. Fixed in 6.4.11-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.4.11-1 | Update the kernel and reboot. Fixed in 6.4.11-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.4.11-1 | Update the kernel and reboot. Fixed in 6.4.11-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
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.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/node.c
include/linux/f2fs_fs.h
- What this is
- F2FS FILE SYSTEMMAINTAINERS section matched on fs/f2fs/ · linux-f2fs-devel@lists.sourceforge.net · Maintained
- Kernel module
- f2fs
Check it on the machine
grep -w CONFIG_F2FS_FS /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
lsmod | grep -w f2fsPrints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.
Show whether Debian builds this, per release
Debian builds this, but not on every flavour. At least one release below builds the code on some of its kernel flavours and not on others, so the answer depends on the architecture and flavour installed.
- bookworm, trixie, forky, sidMnot built on amd64/cloud-amd64, arm64/cloud-arm64
- M
- a module where it is built at all; some flavours do not build it
- Build switch
- CONFIG_F2FS_FS
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2025-12-09 (10 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.17%, higher than 6.0% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- fs/f2fs
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 3.8 | 6.4.10 | af0f716ad3b0 |
| 3.8 | 6.5 | a6ec83786ab9 |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The bug is reached through local syscalls (`creat`/`truncate`/`ftruncate`) on a file in a mounted f2fs image; there is no network-facing path into `truncate_dnode()`. Attack requires local system access to mount the crafted image and operate on it.
- AC:LAttack complexity, low
- The corrupted node reference is fully attacker-controlled on-disk data, and syzbot has a deterministic reproducer — a single truncate on the crafted inode reliably drives the loop past the end of the inode page. No race or uncontrollable state is involved.
- PR:LPrivileges required, low
- An unprivileged local user can get an arbitrary f2fs image mounted on common deployments (udisks2/systemd-mount removable-media policy for active sessions, Android vold adoptable storage), and triggering the truncate afterward needs only ordinary write access to a file. No root in the initial namespace is required in these configurations.
- UI:NUser interaction, none
- The same unprivileged attacker performs both the mount (via the removable-media auto-mount path) and the truncate syscall; no separate victim action is needed once the image is attached.
- S:UScope, unchanged
- The out-of-bounds access and any resulting corruption stay within the kernel's own security authority — this is a standard in-kernel memory-safety flaw with no crossing of a VM, IOMMU, or sandbox boundary.
- C:HConfidentiality impact, high
- The loop performs an out-of-bounds read of ~84 four-byte words past the end of the node page (KASAN reports it as slab-use-after-free), and those adjacent-page values are consumed as block addresses that get invalidated and reflected in the extent cache and block accounting, disclosing adjacent kernel heap contents.
- I:HIntegrity impact, high
- Every non-zero out-of-bounds word triggers `f2fs_set_data_blkaddr()` → `__set_data_blkaddr()`, writing a 4-byte zero through the same OOB pointer — an out-of-bounds write into the neighbouring physical page, plus corruption of SIT/valid-block accounting and freeing of blocks belonging to other inodes.
- A:HAvailability impact, high
- The out-of-bounds access reliably produces a KASAN slab-use-after-free splat and can panic the kernel, and the bogus block addresses and inflated free counts drive `f2fs_invalidate_blocks()`/`dec_valid_block_count()` into `f2fs_bug_on()` conditions.