aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tests
diff options
context:
space:
mode:
authorTim Deegan <tim@xen.org>2012-03-08 16:40:05 +0000
committerTim Deegan <tim@xen.org>2012-03-08 16:40:05 +0000
commit90b6e6c88983250742e1356d7178a6d4e683fa80 (patch)
treecb07b08d3dbb9490f0a865780789cb887dd61c51 /tools/tests
parentdac9bb57eca774e5ab6189c5ff71b38cd5aec701 (diff)
downloadxen-90b6e6c88983250742e1356d7178a6d4e683fa80.tar.gz
xen-90b6e6c88983250742e1356d7178a6d4e683fa80.tar.bz2
xen-90b6e6c88983250742e1356d7178a6d4e683fa80.zip
Tools: After a helper maps a ring, yank it from the guest physmap
This limits the ability of the guest to play around with its own rings, and DoS itself. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'tools/tests')
-rw-r--r--tools/tests/xen-access/xen-access.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index fce886432a..b861aff323 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -269,6 +269,11 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
(mem_event_sring_t *)xenaccess->mem_event.ring_page,
PAGE_SIZE);
+ /* Now that the ring is set, remove it from the guest's physmap */
+ if ( xc_domain_decrease_reservation_exact(xch,
+ xenaccess->mem_event.domain_id, 1, 0, &ring_pfn) )
+ PERROR("Failed to remove ring from guest physmap");
+
/* Get platform info */
xenaccess->platform_info = malloc(sizeof(xc_platform_info_t));
if ( xenaccess->platform_info == NULL )