Skip to contentSkip to conversation

CVE-2022-50446: ARC: mm: fix leakage of memory allocated for PTE

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 1, 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:

ARC: mm: fix leakage of memory allocated for PTE

Since commit d9820ff ("ARC: mm: switch pgtable_t back to struct page *") a memory leakage problem occurs. Memory allocated for page table entries not released during process termination. This issue can be reproduced by a small program that allocates a large amount of memory. After several runs, you'll see that the amount of free memory has reduced and will continue to reduce after each run. All ARC CPUs are effected by this issue. The issue was introduced since the kernel stable release v5.15-rc1.

As described in commit d9820ff after switch pgtable_t back to struct page *, a pointer to "struct page" and appropriate functions are used to allocate and free a memory page for PTEs, but the pmd_pgtable macro hasn't changed and returns the direct virtual address from the PMD (PGD) entry. Than this address used as a parameter in the __pte_free() and as a result this function couldn't release memory page allocated for PTEs.

Fix this issue by changing the pmd_pgtable macro and returning pointer to struct page.

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

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

	Issue introduced in 5.15 with commit d9820ff76f95fa26d33e412254a89cd65b23142d and fixed in 5.15.77 with commit 14009ada5712649589ab4ad0441b811780ea8773
	Issue introduced in 5.15 with commit d9820ff76f95fa26d33e412254a89cd65b23142d and fixed in 6.0.7 with commit d83a69966e8b6ae9dd447f3ac704c0223bceb7f7
	Issue introduced in 5.15 with commit d9820ff76f95fa26d33e412254a89cd65b23142d and fixed in 6.1 with commit 4fd9df10cb7a9289fbd22d669f9f98164d95a1ce

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

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:
arch/arc/include/asm/pgtable-levels.h

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/14009ada5712649589ab4ad0441b811780ea8773
	https://git.kernel.org/stable/c/d83a69966e8b6ae9dd447f3ac704c0223bceb7f7
	https://git.kernel.org/stable/c/4fd9df10cb7a9289fbd22d669f9f98164d95a1ce