# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID d0e9da9cc84a5c58c8b2a9591e02d74f50418d82
# Parent 2dea3be895138f1ac731ee2f241847e63831a1c5
[HVM] Disallow PTE updates and MMIO accesses from hypervisor mode
(prevents copy_to/from_guest from causing problems, for example).
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/mm/shadow/multi.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
diff -r 2dea3be89513 -r d0e9da9cc84a xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c Thu Nov 16 10:50:21 2006 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c Thu Nov 16 10:52:03 2006 +0000
@@ -2798,8 +2798,9 @@ static int sh_page_fault(struct vcpu *v,
* We do not emulate user writes. Instead we use them as a hint that the
* page is no longer a page table. This behaviour differs from native, but
* it seems very unlikely that any OS grants user access to page tables.
+ * We also disallow guest PTE updates from within Xen.
*/
- if ( (regs->error_code & PFEC_user_mode) ||
+ if ( (regs->error_code & PFEC_user_mode) || !guest_mode(regs) ||
x86_emulate_memop(&emul_ctxt, &shadow_emulator_ops) )
{
SHADOW_PRINTK("emulator failure, unshadowing mfn %#lx\n",
@@ -2839,6 +2840,8 @@ static int sh_page_fault(struct vcpu *v,
goto done;
mmio:
+ if ( !guest_mode(regs) )
+ goto not_a_shadow_fault;
perfc_incrc(shadow_fault_mmio);
sh_audit_gw(v, &gw);
unmap_walk(v, &gw);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|