Subject: CVE-2024-42258: mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines

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

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

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

mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines

Yves-Alexis Perez reported commit 4ef9ad19e176 ("mm: huge_memory: don't
force huge page alignment on 32 bit") didn't work for x86_32 [1].  It is
because x86_32 uses CONFIG_X86_32 instead of CONFIG_32BIT.

!CONFIG_64BIT should cover all 32 bit machines.

[1] https://lore.kernel.org/linux-mm/CAHbLzkr1LwH3pcTgM+aGQ31ip2bKqiqEQ8=[email-masked]/

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

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

	Issue introduced in 6.1.81 with commit 87632bc9ecff and fixed in 6.1.105 with commit 89f2914dd4b4
	Issue introduced in 6.8 with commit 4ef9ad19e176 and fixed in 6.10.3 with commit 7e1f4efb8d61
	Issue introduced in 6.8 with commit 4ef9ad19e176 and fixed in 6.11 with commit d9592025000b
	Issue introduced in 6.7.6 with commit 7432376c9133

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-42258
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:
	mm/huge_memory.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/89f2914dd4b47d2fad3deef0d700f9526d98d11f
	https://git.kernel.org/stable/c/a5c399fe433a115e9d3693169b5f357f3194af0a
	https://git.kernel.org/stable/c/7e1f4efb8d6140b2ec79bf760c43e1fc186e8dfc
	https://git.kernel.org/stable/c/d9592025000b3cf26c742f3505da7b83aedc26d5