Skip to content
Medium 4.4

f2fs: fix defragment writeback range truncation on 32-bit

CVE-2026-100094 First seen on SecPulse

Affected packages

PackageAffected → Fixed
LinuxLinux —
LinuxKernel
≥ 4.5.0, < 5.15.226→ 5.15.226
≥ 5.16.0, < 6.1.193→ 6.1.193
≥ 6.2.0, < 6.6.163→ 6.6.163
≥ 6.7.0, < 6.12.117→ 6.12.117
≥ 6.13.0, < 6.18.63→ 6.18.63
≥ 6.19.0, < 7.3.4→ 7.3.4

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

In the Linux kernel, the following vulnerability has been resolved:

f2fs: fix defragment writeback range truncation on 32-bit

f2fs_defragment_range() flushes the range it is about to defragment:

filemap_write_and_wait_range(inode->i_mapping,
			pg_start << PAGE_SHIFT,
			(pg_end << PAGE_SHIFT) - 1);

pg_start and pg_end are pgoff_t, 32 bits on 32-bit kernels, so both
shifts are evaluated in 32 bits and truncated before they are widened to
the loff_t parameters. pg_end is only capped by the file's page count,
so for a file larger than 4 GiB the shift wraps.

For a 5 GiB file pg_end is 1310720 and the range collapses from
[0, 5 GiB) to [0, 1 GiB), leaving the rest of the dirty pages unwritten
before the blocks are moved. For 8 GiB the shift yields 0, the minus one
makes it (loff_t)-1, and the range becomes [0, LLONG_MAX].

The matching call in f2fs_collapse_range() already casts:

filemap_write_and_wait_range(inode->i_mapping,
			(loff_t)index << PAGE_SHIFT,
			((loff_t)pg_end << PAGE_SHIFT) - 1);

Do the same here. On i386 the shift changes from "shl $0xc,%ecx" to
"shld", i.e. from a 32-bit shift to a double-precision one.

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details