Skip to contentSkip to conversation

CVE-2022-49991: mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 18, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte

In MCOPY_ATOMIC_CONTINUE case with a non-shared VMA, pages in the page cache are installed in the ptes. But hugepage_add_new_anon_rmap is called for them mistakenly because they're not vm_shared. This will corrupt the page->mapping used by page cache code.

The Linux kernel CVE team has assigned CVE-2022-49991 to this issue.

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

	Issue introduced in 5.13 with commit f619147104c8ea71e120e4936d2b68ec11a1e527 and fixed in 5.15.65 with commit da60ddd80d09f8371fbba1a238a4b318d13ba698
	Issue introduced in 5.13 with commit f619147104c8ea71e120e4936d2b68ec11a1e527 and fixed in 5.19.6 with commit 3ada1b3e58db255a14ec73a59d7913e84dc5a8a4
	Issue introduced in 5.13 with commit f619147104c8ea71e120e4936d2b68ec11a1e527 and fixed in 6.0 with commit ab74ef708dc51df7cf2b8a890b9c6990fac5c0c6

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-2022-49991

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/hugetlb.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/da60ddd80d09f8371fbba1a238a4b318d13ba698
	https://git.kernel.org/stable/c/3ada1b3e58db255a14ec73a59d7913e84dc5a8a4
	https://git.kernel.org/stable/c/ab74ef708dc51df7cf2b8a890b9c6990fac5c0c6