Xen 64-bit X86 PV Guest Top-Level Pagetable Write Arbitrary Entries
This vulnerability in Xen permits an attacker with control over the kernel of a 64bit X86 PV guest to write arbitrary entries into a live top-level pagetable. This is possible due to the fact that the arch.cr3 field in the vcpu struct does not take an extra type-specific reference, and instead borrows the reference from either arch.guest_table_user or arch.guest_table. This means that whenever the field from which the reference is borrowed is updated, arch.cr3 (together with the physical CR3) must be updated as well. The guest can update arch.guest_table_user and arch.guest_table using __HYPERVISOR_mmuext_op with commands MMUEXT_NEW_USER_BASEPTR and MMUEXT_NEW_BASEPTR. The handlers for these commands assume that when the hypercall is executed, arch.cr3 always equals arch.guest_table, however, using the __HYPERVISOR_multicall hypercall, it is possible to execute the __HYPERVISO_mmuext_op hypercall from user context.