{"id":"CVE-2022-49562","state":"PUBLISHED","title":"KVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits\n\nUse the recently introduced __try_cmpxchg_user() to update guest PTE A/D\nbits instead of mapping the PTE into kernel address space.  The VM_PFNMAP\npath is broken as it assumes that vm_pgoff is the base pfn of the mapped\nVMA range, which is conceptually wrong as vm_pgoff is the offset relative\nto the file and has nothing to do with the pfn.  The horrific hack worked\nfor the original use case (backing guest memory with /dev/mem), but leads\nto accessing \"random\" pfns for pretty much any other VM_PFNMAP case.","publishedAt":"2025-02-26T02:14:06.515Z","updatedAt":"2026-08-05T08:55:46.165Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"38b888911e8dc89b89d8147cfb1d2dbe6373bf78","versionType":"git"},{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"8089e5e1d18402fb8152d6b6815450a36fffa9b0","versionType":"git"},{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"f122dfe4476890d60b8c679128cd2259ec96a24c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/mmu/paging_tmpl.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.17.13","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.2","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/mmu/paging_tmpl.h"]}],"references":["https://git.kernel.org/stable/c/38b888911e8dc89b89d8147cfb1d2dbe6373bf78","https://git.kernel.org/stable/c/8089e5e1d18402fb8152d6b6815450a36fffa9b0","https://git.kernel.org/stable/c/f122dfe4476890d60b8c679128cd2259ec96a24c"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/49xxx/CVE-2022-49562.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49562","state":"PUBLISHED","datePublished":"2025-02-26T02:14:06.515Z","dateUpdated":"2026-08-05T08:55:46.165Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-02-26T02:08:31.591Z"},"containers":{"cna":{"title":"KVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits\n\nUse the recently introduced __try_cmpxchg_user() to update guest PTE A/D\nbits instead of mapping the PTE into kernel address space.  The VM_PFNMAP\npath is broken as it assumes that vm_pgoff is the base pfn of the mapped\nVMA range, which is conceptually wrong as vm_pgoff is the offset relative\nto the file and has nothing to do with the pfn.  The horrific hack worked\nfor the original use case (backing guest memory with /dev/mem), but leads\nto accessing \"random\" pfns for pretty much any other VM_PFNMAP case."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"38b888911e8dc89b89d8147cfb1d2dbe6373bf78","versionType":"git"},{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"8089e5e1d18402fb8152d6b6815450a36fffa9b0","versionType":"git"},{"version":"bd53cb35a3e9adb73a834a36586e9ad80e877767","status":"affected","lessThan":"f122dfe4476890d60b8c679128cd2259ec96a24c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/mmu/paging_tmpl.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.17.13","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.2","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/x86/kvm/mmu/paging_tmpl.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/38b888911e8dc89b89d8147cfb1d2dbe6373bf78"},{"url":"https://git.kernel.org/stable/c/8089e5e1d18402fb8152d6b6815450a36fffa9b0"},{"url":"https://git.kernel.org/stable/c/f122dfe4476890d60b8c679128cd2259ec96a24c"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Exploitation requires local access to /dev/kvm and KVM ioctls (KVM_CREATE_VM/VCPU, KVM_SET_USER_MEMORY_REGION, KVM_TRANSLATE or guest page walks); it is not reachable via network packets.\nAC:L - The attacker fully controls the VM_PFNMAP backing (e.g. io_uring SQE mmap), guest page-table contents, and the ioctl/page-walk trigger, and public reproducers reliably hit the bad memremap/CMPXCHG path.\nPR:L - /dev/kvm is usable by unprivileged local users (kvm group or equivalent); no root or init-namespace admin capability is required, as confirmed by the CVE-2022-1158 disclosure.\nUI:N - The attacker triggers the bug entirely from their own process via KVM and mmap syscalls; no victim action is required.\nS:U - A host userspace KVM client corrupts the host kernel in the same privilege domain; this is local privilege escalation, not a guest-to-host escape across a VM boundary.\nC:H - The bug writes to attacker-influenced wrong physical pages (demonstrated UAF/kernel corruption), which can be leveraged for privilege escalation and thus full confidentiality compromise.\nI:H - cmpxchg_gpte() performs an out-of-bounds CMPXCHG write into incorrectly computed physical memory, enabling arbitrary kernel memory corruption and potential control-flow hijacking.\nA:H - The erroneous physical write reliably causes kernel faults/UAF crashes (as shown by KASAN in the public reproducer), yielding high availability impact."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:55:46.165Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.17.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.18.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}