CVE-2021-47007: f2fs: fix panic during f2fs_resize_fs()
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix panic during f2fs_resize_fs()
f2fs_resize_fs() hangs in below callstack with testcase:
- mkfs 16GB image & mount image
- dd 8GB fileA
- dd 8GB fileB
- sync
- rm fileA
- sync
- resize filesystem to 8GB
kernel BUG at segment.c:2484!
Call Trace:
allocate_segment_by_default+0x92/0xf0 [f2fs]
f2fs_allocate_data_block+0x44b/0x7e0 [f2fs]
do_write_page+0x5a/0x110 [f2fs]
f2fs_outplace_write_data+0x55/0x100 [f2fs]
f2fs_do_write_data_page+0x392/0x850 [f2fs]
move_data_page+0x233/0x320 [f2fs]
do_garbage_collect+0x14d9/0x1660 [f2fs]
free_segment_range+0x1f7/0x310 [f2fs]
f2fs_resize_fs+0x118/0x330 [f2fs]
__f2fs_ioctl+0x487/0x3680 [f2fs]
__x64_sys_ioctl+0x8e/0xd0
do_syscall_64+0x33/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xa9
The root cause is we forgot to check that whether we have enough space
in resized filesystem to store all valid blocks in before-resizing
filesystem, then allocator will run out-of-space during block migration
in free_segment_range().
Security readout for executives and security teams
Plain-English summary
This Linux kernel issue can crash a system when an F2FS filesystem is resized too small to hold existing valid data blocks. It is primarily an availability and operations risk for systems using F2FS, especially where filesystem resizing is performed. The source bundle does not show remote exploitation, privilege context, or data theft impact.
Executive priority
Treat this as a targeted availability risk, not a broad emergency. Prioritize systems that use F2FS and perform resize operations, especially embedded, mobile, appliance, or storage workflows where a kernel panic would cause service interruption.
Technical view
The bug is in F2FS resize handling. During f2fs_resize_fs(), the kernel failed to verify that the resized filesystem had enough space for valid blocks before block migration. The allocator can then run out of space during free_segment_range(), triggering a kernel BUG and panic. Stable kernel fixes are referenced by upstream commit URLs.
Likely exposure
Exposure appears limited to Linux systems using F2FS and performing filesystem resize operations. The provided affected data lists Linux kernel versions or identifiers around 5.8 through 5.13, but exact distribution package impact requires vendor mapping.
Exploitation context
No active exploitation is cited, and KEV is false in the source bundle. The described trigger is an operational resize scenario, not a remote attack path. Evidence is incomplete for attacker prerequisites, required privileges, and whether untrusted users can reach the vulnerable ioctl in real deployments.
Researcher notes
The public description gives a clear root cause and call trace, but lacks CVSS, CWE, exploitability analysis, and distribution-specific package status. Research should focus on reachability of F2FS resize ioctls, required privileges, and confirming which maintained kernels carry the listed fixes.
Mitigation direction
Apply vendor kernel updates that include the referenced upstream stable fixes.
Check distribution advisories for backported fixes before relying on version numbers alone.
Avoid F2FS shrink operations on unpatched systems where availability matters.
Validate enough free space exists before planned F2FS resize operations.
Use vendor guidance if no specific package fix is available.
Validation and detection
Inventory Linux systems using F2FS filesystems.
Map running kernels to vendor packages and the referenced stable commits.
Review change logs for F2FS resize or shrink operations.
Check kernel logs for f2fs_resize_fs, segment.c BUG, or panic indicators.
Confirm test and production kernel update coverage before resuming resize workflows.
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-2021-47007 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.