Look up another CVE · open CVE-2025-38333 in the interactive tracker
CVE-2025-38333
f2fs: fix to bail out in get_new_segment()
Published 2025-07-10 (15 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-2025-38333 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.12.35-1 | Update the kernel and reboot. Fixed in 6.12.35-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.12.35-1 | Update the kernel and reboot. Fixed in 6.12.35-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.12.35-1 | Update the kernel and reboot. Fixed in 6.12.35-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
------------[ cut here ]------------ WARNING: CPU: 3 PID: 579 at fs/f2fs/segment.c:2832 new_curseg+0x5e8/0x6dc pc : new_curseg+0x5e8/0x6dc Call trace: new_curseg+0x5e8/0x6dc f2fs_allocate_data_block+0xa54/0xe28 do_write_page+0x6c/0x194 f2fs_do_write_node_page+0x38/0x78 __write_node_page+0x248/0x6d4 f2fs_sync_node_pages+0x524/0x72c f2fs_write_checkpoint+0x4bc/0x9b0 __checkpoint_and_complete_reqs+0x80/0x244 issue_checkpoint_thread+0x8c/0xec kthread+0x114/0x1bc ret_from_fork+0x10/0x20 get_new_segment() detects inconsistent status in between free_segmap and free_secmap, let's record such error into super block, and bail out get_new_segment() instead of continue using the segment.
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/segment.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-07-10 (15 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.18%, higher than 7.5% 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.12.35 | f0023d7a2a86 |
| 3.8 | 6.15.4 | ca860f507a61 |
| 3.8 | 6.16 | bb5eb8a5b222 |
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
- get_new_segment() is reached only through the f2fs allocator on a locally mounted volume — ordinary writes, fsync, GC, or the background checkpoint thread; there is no network-facing consumer of this code.
- AC:LAttack complexity, low
- Once the free_segmap/free_secmap divergence exists — from attacker-supplied on-disk metadata on removable f2fs media or the in-kernel state divergence observed in the field — the condition is hit deterministically on the next allocation from that section, with no race window or memory layout the attacker must win.
- PR:LPrivileges required, low
- On an already-mounted f2fs volume (Android /data, auto-mounted SD/USB), any unprivileged local user with write access drives segment allocation via normal file writes and fsync; no capability or CAP_SYS_ADMIN is needed for the trigger itself.
- UI:NUser interaction, none
- The reported failure fires on the background checkpoint kthread during ordinary operation on an already-mounted filesystem, and removable f2fs media are auto-mounted by vold/udisks2 without any action by another user.
- S:UScope, unchanged
- The corruption is confined to the kernel/f2fs security authority on the same host; no VM, IOMMU, or sandbox boundary is crossed.
- C:HConfidentiality impact, high
- The already-in-use segment is handed out as a new current segment starting at block offset 0, so the same physical blocks become mapped by two different inodes and a reader of one file obtains blocks written for another user's file on a shared filesystem.
- I:HIntegrity impact, high
- Live data and node blocks belonging to other files are physically overwritten, SIT valid_blocks/cur_valid_map are corrupted, and the underflowed free_segments count is persisted into the on-disk checkpoint (ckpt->free_segment_count is never validated on read), so the damage survives reboot.
- A:HAvailability impact, high
- With CONFIG_F2FS_CHECK_FS the f2fs_bug_on is a plain BUG_ON taken while holding free_i->segmap_lock on the checkpoint kthread — an immediate panic; otherwise the free_segments/free_sections underflow defeats GC accounting and the downstream f2fs_bug_on()s and -ENOSPC path end in f2fs_stop_checkpoint(), shutting the filesystem down.