Skip to contentSkip to conversation

CVE-2022-49562: KVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits

DISCUSSION Greg Kroah-Hartman 2 participants 3 messages Feb 26, 2025 – Mar 16, 2025

lore
Share & tools
lore
#0 lore raw

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

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

KVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits

Use the recently introduced __try_cmpxchg_user() to update guest PTE A/D bits instead of mapping the PTE into kernel address space. The VM_PFNMAP path is broken as it assumes that vm_pgoff is the base pfn of the mapped VMA range, which is conceptually wrong as vm_pgoff is the offset relative to the file and has nothing to do with the pfn. The horrific hack worked for the original use case (backing guest memory with /dev/mem), but leads to accessing "random" pfns for pretty much any other VM_PFNMAP case.

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

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

	Issue introduced in 5.2 with commit bd53cb35a3e9adb73a834a36586e9ad80e877767 and fixed in 5.17.13 with commit 38b888911e8dc89b89d8147cfb1d2dbe6373bf78
	Issue introduced in 5.2 with commit bd53cb35a3e9adb73a834a36586e9ad80e877767 and fixed in 5.18.2 with commit 8089e5e1d18402fb8152d6b6815450a36fffa9b0
	Issue introduced in 5.2 with commit bd53cb35a3e9adb73a834a36586e9ad80e877767 and fixed in 5.19 with commit f122dfe4476890d60b8c679128cd2259ec96a24c

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

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/x86/kvm/mmu/paging_tmpl.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/38b888911e8dc89b89d8147cfb1d2dbe6373bf78
	https://git.kernel.org/stable/c/8089e5e1d18402fb8152d6b6815450a36fffa9b0
	https://git.kernel.org/stable/c/f122dfe4476890d60b8c679128cd2259ec96a24c
#1 lore raw

Hi, it seems the problem reflected by CVE-2022-49545 has been fixed by 2a8859f373b0. I wonder if applying 2a8859f373b0 could solve the problem

author
#2 lore raw
Quoted 2 lines · zhangkunbo

Hi, it seems the problem reflected by CVE-2022-49545 has been fixed by 2a8859f373b0. I wonder if applying 2a8859f373b0 could solve the problem

I'm sorry, but I do not understand what you are talking about here. The CVE-2022-49545 is an ALSA issue, not KVM.

totally confused,

greg k-h