Subject: CVE-2024-0052: mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval

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

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

mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval

set_memmap_mode() stores the kernel parameter memmap mode as an integer. 
However, the get_memmap_mode() function utilizes param_get_bool() to fetch
the value as a boolean, leading to potential endianness issue.  On
Big-endian architectures, the memmap_on_memory is consistently displayed
as 'N' regardless of its actual status.

To address this endianness problem, the solution involves obtaining the
mode as an integer.  This adjustment ensures the proper display of the
memmap_on_memory parameter, presenting it as one of the following options:
Force, Y, or N.

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

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

	Issue introduced in 6.6 with commit 2d1f649c7c08 and fixed in 6.6.13 with commit 9584c8d658c0
	Issue introduced in 6.6 with commit 2d1f649c7c08 and fixed in 6.7.1 with commit 0f91df0c0fae
	Issue introduced in 6.6 with commit 2d1f649c7c08 and fixed in 6.8-rc1 with commit 11684134140b

Please see https://www.kernel.org or 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-0052
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/memory_hotplug.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/9584c8d658c0
	https://git.kernel.org/stable/c/0f91df0c0fae
	https://git.kernel.org/stable/c/11684134140b