aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>2012-01-26 13:21:27 +0000
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>2012-01-26 13:21:27 +0000
commit8e98287101d630a19d694fdfa01c5f716d96470c (patch)
tree22a3dbcc016310f249bb60602e9205ed4b4eb6e2 /xen
parentad6c917d7da2cc1dbcb6c8aa19ee0f9866d76f4e (diff)
downloadxen-8e98287101d630a19d694fdfa01c5f716d96470c.tar.gz
xen-8e98287101d630a19d694fdfa01c5f716d96470c.tar.bz2
xen-8e98287101d630a19d694fdfa01c5f716d96470c.zip
x86/mm: Allow foreign read-only mappings of shared pages
Because shared pages are owned by dom_cow, the ownership test while foreign mapping fails. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen')
-rw-r--r--xen/arch/x86/mm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2183bade33..fc954bb8e3 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -878,7 +878,8 @@ get_page_from_l1e(
return 1;
}
- if ( unlikely(real_pg_owner != pg_owner) )
+ if ( unlikely( (real_pg_owner != pg_owner) &&
+ (real_pg_owner != dom_cow) ) )
{
/*
* Let privileged domains transfer the right to map their target
@@ -892,6 +893,11 @@ get_page_from_l1e(
pg_owner = real_pg_owner;
}
+ /* Extra paranoid check for shared memory. Writable mappings
+ * disallowed (unshare first!) */
+ if ( (l1f & _PAGE_RW) && (real_pg_owner == dom_cow) )
+ goto could_not_pin;
+
/* Foreign mappings into guests in shadow external mode don't
* contribute to writeable mapping refcounts. (This allows the
* qemu-dm helper process in dom0 to map the domain's memory without