Skip to contentSkip to conversation

CVE-2026-97534: f2fs: accurately adjust free_sections during free_segment_range

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

f2fs: accurately adjust free_sections during free_segment_range

In free_segment_range(), MAIN_SECS(sbi) is temporarily reduced by secs to restrict block allocation to the safe remaining main area while valid blocks in the truncated range are evacuated by GC.

However, FREE_I(sbi)->free_sections tracks the total number of free sections across the whole filesystem. If any sections within the truncated range were already free upon entering free_segment_range(), failing to deduct them from free_sections causes the filesystem to overestimate available free sections in the active, reduced main area. This leads to inconsistent free section accounting during GC data migration and can trigger unexpected allocation failures or assertion errors when space is tight.

Fix this by calculating the number of already-free sections in the truncated range, deducting them from free_sections upon entering free_segment_range(), and restoring them on exit.

The Linux kernel CVE team has assigned CVE-2026-97534 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.8 with commit b4b10061ef98c583bcf82a4200703fbaa98c18dc and fixed in 6.18.53 with commit ca31116fad0954c61a0d38163cc51c48e4981b75
	Issue introduced in 5.8 with commit b4b10061ef98c583bcf82a4200703fbaa98c18dc and fixed in 7.2.7 with commit 8a123a10770d2132d046748f20f02baa8d5539a1
	Issue introduced in 5.8 with commit b4b10061ef98c583bcf82a4200703fbaa98c18dc and fixed in 7.3-rc1 with commit 8c963d1738fdca400082ff5f9d99e083de4f4e70

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-97534

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:

	fs/f2fs/gc.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/ca31116fad0954c61a0d38163cc51c48e4981b75
	https://git.kernel.org/stable/c/8a123a10770d2132d046748f20f02baa8d5539a1
	https://git.kernel.org/stable/c/8c963d1738fdca400082ff5f9d99e083de4f4e70