xen/x86: adjust handling of the L3 user vsyscall special page table
authorJan Beulich <jbeulich@suse.com>
Thu, 30 Sep 2021 12:36:16 +0000 (14:36 +0200)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 2 Nov 2021 12:45:43 +0000 (07:45 -0500)
commitd2a3ef44c2a2e49fc08270a9d33f0e4918ee2cb9
tree6d4d50e39e3e97a738f19fecb2e78ea3db5ed3f2
parent4c360db6ccdb12d82c5c255c90c249970f5d1956
xen/x86: adjust handling of the L3 user vsyscall special page table

Marking the page tableas pinned without ever actually pinning is was
probably an oversight in the first place. The main reason for the change
is more subtle, though: The write of the one present entry each here and
in the subsequently allocated L2 table engage a code path in the
hypervisor which exists only for thought-to-be-broken guests: An mmu-
update operation to a page which is neither a page table nor marked
writable. The hypervisor merely assumes (or should I say "hopes") that
the fact that a writable reference to the page can be obtained means it
is okay to actually write to that page in response to such a hypercall.

While there make all involved code and data dependent upon
X86_VSYSCALL_EMULATION (some code was already).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/1048f5b8-b726-dcc1-1216-9d5ac328ce82@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/x86/xen/mmu_pv.c