x86/mm: correct TLB flush condition in _get_page_type()
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Jul 2022 12:59:07 +0000 (14:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Jul 2022 12:59:07 +0000 (14:59 +0200)
commit221f6a97b59e008f11eb310ad0c9b802f3bea233
tree3b48cf3319ba8b253b620d41c2fbf85496e256fc
parent0a5387a01165b46c8c85e7f7e2ddbe60a7f5db44
x86/mm: correct TLB flush condition in _get_page_type()

When this logic was moved, it was moved across the point where nx is
updated to hold the new type for the page. IOW originally it was
equivalent to using x (and perhaps x would better have been used), but
now it isn't anymore. Switch to using x, which then brings things in
line again with the slightly earlier comment there (now) talking about
transitions _from_ writable.

I have to confess though that I cannot make a direct connection between
the reported observed behavior of guests leaving several pages around
with pending general references and the change here. Repeated testing,
nevertheless, confirms the reported issue is no longer there.

This is CVE-2022-33745 / XSA-408.

Reported-by: Charles Arnold <carnold@suse.com>
Fixes: 8cc5036bc385 ("x86/pv: Fix ABAC cmpxchg() race in _get_page_type()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: a9949efb288fd6e21bbaf9d5826207c7c41cda27
master date: 2022-07-26 14:54:34 +0200
xen/arch/x86/mm.c