CVE-2026-31702: f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
In f2fs_compress_write_end_io(), dec_page_count(sbi, type) can bring
the F2FS_WB_CP_DATA counter to zero, unblocking
f2fs_wait_on_all_pages() in f2fs_put_super() on a concurrent unmount
CPU. The unmount path then proceeds to call
f2fs_destroy_page_array_cache(sbi), which destroys
sbi->page_array_slab via kmem_cache_destroy(), and eventually
kfree(sbi). Meanwhile, the bio completion callback is still executing:
when it reaches page_array_free(sbi, ...), it dereferences
sbi->page_array_slab — a destroyed slab cache — to call
kmem_cache_free(), causing a use-after-free.
This is the same class of bug as CVE-2026-23234 (which fixed the
equivalent race in f2fs_write_end_io() in data.c), but in the
compressed writeback completion path that was not covered by that fix.
Fix this by moving dec_page_count() to after page_array_free(), so
that all sbi accesses complete before the counter decrement that can
unblock unmount. For non-last folios (where atomic_dec_return on
cic->pending_pages is nonzero), dec_page_count is called immediately
before returning — page_array_free is not reached on this path, so
there is no post-decrement sbi access. For the last folio,
page_array_free runs while the F2FS_WB_CP_DATA counter is still
nonzero (this folio has not yet decremented it), keeping sbi alive,
and dec_page_count runs as the final operation.
Security readout for executives and security teams
Plain-English summary
CVE-2026-31702 is a Linux kernel F2FS bug in compressed writeback cleanup. A race during unmount can let kernel code use freed filesystem state, causing memory corruption or a crash. Sources do not provide CVSS, CWE, or evidence of active exploitation.
Executive priority
Treat this as a targeted kernel maintenance issue unless your fleet uses F2FS compression. Prioritize patch validation for Linux endpoints, appliances, or storage workflows using F2FS; otherwise track through normal kernel update governance.
Technical view
In f2fs_compress_write_end_io(), dec_page_count() can unblock f2fs_put_super() while the bio completion callback still uses sbi. Unmount can destroy sbi->page_array_slab and free sbi before page_array_free() dereferences it. Stable fixes move the decrement after the remaining sbi access.
Likely exposure
Exposure appears limited to Linux systems using F2FS, especially compressed writeback paths. The source bundle lists affected Linux kernel version ranges and stable kernel commits, but does not identify distributions, appliances, cloud images, or default configurations.
Exploitation context
The bundle describes a concurrent unmount and compressed writeback completion race. It does not state remote exploitability, privilege requirements, reliable exploitation, or public weaponization. KEV is false, so active exploitation is not supported by the provided evidence.
Researcher notes
This is the compressed-path counterpart to the earlier f2fs_write_end_io() race described as CVE-2026-23234. The fix preserves sbi lifetime by keeping F2FS_WB_CP_DATA nonzero until page_array_free() finishes on the last folio path.
Mitigation direction
Update to a vendor kernel that includes the listed stable F2FS fixes.
Confirm distribution advisories map CVE-2026-31702 to your deployed kernel packages.
Prioritize systems using F2FS compression or frequent removable-media unmount workflows.
If no fixed package exists, request vendor guidance for temporary operational controls.
Validation and detection
Inventory Linux kernels and identify systems using F2FS filesystems.
Check whether F2FS compression is enabled on exposed systems.
Review kernel changelogs for CVE-2026-31702 or the listed stable commits.
Confirm patched systems run a kernel build containing the F2FS writeback fix.
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-2026-31702 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.
0CVSS vectors
3Timeline events
0ADP providers
7Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
May 1, 2026, 13:56 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.