diff options
author | 2022-02-02 00:49:43 +0000 | |
---|---|---|
committer | 2022-04-13 13:37:47 -0400 | |
commit | f122dfe4476890d60b8c679128cd2259ec96a24c (patch) | |
tree | fe213d93903cf4875821b7588600c7fd4fb4a578 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | x86/uaccess: Implement macros for CMPXCHG on user addresses (diff) | |
download | linux-dev-f122dfe4476890d60b8c679128cd2259ec96a24c.tar.xz linux-dev-f122dfe4476890d60b8c679128cd2259ec96a24c.zip |
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.
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Debugged-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Tested-by: Tadeusz Struk <tadeusz.struk@linaro.org>
Reported-by: syzbot+6cde2282daa792c49ab8@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220202004945.2540433-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions