Skip to contentSkip to conversation

CVE-2026-98135: ntfs: reject invalid sectors_per_cluster in the boot sector

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:

ntfs: reject invalid sectors_per_cluster in the boot sector

is_boot_sector_ntfs() checks the boot sector's sectors_per_cluster field with a range test that rejects 0x81..0xf3 but accepts 0 and other non-power-of-two counts. A zero value reaches parse_ntfs_boot_sector():

	sectors_per_cluster_bits = ffs(sectors_per_cluster) - 1;
	...
	vol->cluster_size = vol->sector_size << sectors_per_cluster_bits;

ffs(0) is 0, so sectors_per_cluster_bits becomes (unsigned)-1 and the shift is undefined:

  UBSAN: shift-out-of-bounds in fs/ntfs/super.c:673:39
  shift exponent 4294967295 is too large for 32-bit type 'int'

This change rejects any non-power-of-two value, since it feeds the aforementioned shift via ffs() - 1, which only yields the correct shift for a power of two.

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

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

	Issue introduced in 7.1 with commit 6251f0b0de7d645e3591931ca4c11d8322c1866f and fixed in 7.2.7 with commit 7524c3145a3bac92bebbc47a29c007f1d874c9b3
	Issue introduced in 7.1 with commit 6251f0b0de7d645e3591931ca4c11d8322c1866f and fixed in 7.3-rc2 with commit 323751a604e7533fa473874d999371592a614207

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-98135

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/ntfs/super.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/7524c3145a3bac92bebbc47a29c007f1d874c9b3
	https://git.kernel.org/stable/c/323751a604e7533fa473874d999371592a614207