Subject: CVE-2024-47700: ext4: check stripe size compatibility on remount as well

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

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

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

ext4: check stripe size compatibility on remount as well

We disable stripe size in __ext4_fill_super if it is not a multiple of
the cluster ratio however this check is missed when trying to remount.
This can leave us with cases where stripe < cluster_ratio after
remount:set making EXT4_B2C(sbi->s_stripe) become 0 that can cause some
unforeseen bugs like divide by 0.

Fix that by adding the check in remount path as well.

The Linux kernel CVE team has assigned CVE-2024-47700 to this issue.

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

	Issue introduced in 6.5 with commit c3defd99d58c and fixed in 6.6.54 with commit faeff8b1ee2e
	Issue introduced in 6.5 with commit c3defd99d58c and fixed in 6.10.13 with commit 297615e992bb
	Issue introduced in 6.5 with commit c3defd99d58c and fixed in 6.11.2 with commit a31b712f7544
	Issue introduced in 6.5 with commit c3defd99d58c and fixed in 6.12-rc1 with commit ee85e0938aa8

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-2024-47700
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/ext4/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/faeff8b1ee2eaa5969c8e994d66c3337298cefed
	https://git.kernel.org/stable/c/297615e992bbb30a55c158141086be6505d5d722
	https://git.kernel.org/stable/c/a31b712f75445d52fc0451dc54fd7b16a552cb7c
	https://git.kernel.org/stable/c/ee85e0938aa8f9846d21e4d302c3cf6a2a75110d