Overview
CVE-2026-100094 documents a focused logic bug in the upstream Linux kernel's f2fs driver. The vulnerability lives in f2fs_defragment_range(), where the code flushes dirty pages in the area it is about to relocate. The flush takes byte offsets of type loff_t, but the code derives those offsets from page indices using a left shift by PAGE_SHIFT. On 32-bit builds that arithmetic runs at 32-bit precision, so the resulting byte offset is truncated and only the lower portion of the requested range is written back. The upstream fix adds the same loff_t widening cast that the sibling flush call in the same function already uses, ensuring the byte offset is computed with full precision.
Affected systems
- Product: the upstream Linux kernel.
- Subsystem: the f2fs driver, specifically the
f2fs_defragment_range()code path.
- Trigger condition: 32-bit kernel builds. The commit message confirms the fingerprint on i386, where the generated shift instruction changes from a plain 32-bit
shl $0xc,%ecxto a double-precisionshld, demonstrating that 64-bit builds route through a different widening path and are not exposed to the same truncation.
- Reachability: reachable through the f2fs defragmentation ioctl interface and through any internal callers that drive f2fs defragmentation; the source does not enumerate which kernel versions or stable/LTS branches carry the fix.
- Deployment relevance: 32-bit kernels in general-purpose server and desktop estates are uncommon in 2026, but mobile, embedded and IoT images still ship 32-bit kernels with f2fs support, and those are the realistic exposure surface.
Technical analysis
The root cause is an arithmetic width mismatch. filemap_write_and_wait_range() takes its start and end parameters as loff_t byte offsets, while the caller supplies them as page index << PAGE_SHIFT. Without an explicit (loff_t) cast the shift is performed on the narrower integer type of the page index, so the upper bits of the byte offset vanish before the kernel interprets it as a 64-bit file offset. The fix mirrors the pattern already used elsewhere in the same function:
- start:
(loff_t)index << PAGE_SHIFT
- end:
((loff_t)pg_end << PAGE_SHIFT) - 1
With the cast evaluated before the shift, the intermediate value is widened to loff_t and the bit pattern survives.
The security character of this defect is a filesystem-consistency hazard rather than a memory-corruption or input-validation flaw. A truncated flush can leave stale dirty pages outside the flushed window when the extents are rewritten during defragmentation, which can produce inconsistency scenarios such as stale data attached to relocated extents or unexpected writeback ordering after the operation. NVD does not record a CVSS vector for the CVE, the issue is not listed in CISA's Known Exploited Vulnerabilities catalog, and the provided material contains no exploitation evidence. Combining that with the requirement to drive defragmentation on a 32-bit f2fs mount restricts the realism of an external attacker path.
Mitigation
- Patch: apply the upstream change to
f2fs_defragment_range()that wraps the page indices in an explicit(loff_t)cast before applyingPAGE_SHIFT. Distributors should verify whether the change has been queued to their stable and LTS branches; the provided context does not list specific maintainer releases or backport status.
- Architecture fallback: prefer 64-bit kernel builds. On 64-bit the shift routes through a wider precision path regardless of whether the patch is deployed, which sidesteps the truncation symptom.
- Operational fallback: limit
F2FS_IOC_DEFRAGMENTusage on 32-bit f2fs mounts to controlled administrative windows until the patched kernel is in place, so that any truncated flush interacts with quiesced I/O rather than live workloads.
- Static check: kernel trees targeting i386 can be scanned for
filemap_write_and_wait_rangecall sites in the f2fs subsystem that pass an un-cast page index, which would indicate the vulnerable pattern remains.
Recommendations
- Confirm the upstream commit and any stable/LTS backport on every distribution that ships a 32-bit f2fs-capable kernel image.
- Prefer 64-bit kernels for any system running f2fs in production wherever the hardware allows it.
- Avoid unattended or scripted f2fs defragmentation on 32-bit builds until the patch is verified.
References
- git.kernel.org/stable/c/159489fafc3f9a5c8b2c2c4778b93b5b7f4ee4b1
- git.kernel.org/stable/c/16cb21f3f99296c2c93da11158d2c6a3577ba370
- git.kernel.org/stable/c/465d1f88b83828f969113faef1978fe6da0ca17f
- git.kernel.org/stable/c/55e004e52af96801577b6c3c4d52a578f369f4b5
- git.kernel.org/stable/c/92154fe28c3701bebf75176dc5522bec62519a8f
- git.kernel.org/stable/c/c58db6d7e4ac63921940abd6c506621de78fd972
- git.kernel.org/stable/c/ff39a2d5d66e6cd74f04d40ac36db5952a302271