[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Tools: After a helper maps a ring, yank it from the guest physmap



# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1331224805 0
# Node ID 04673ecb9d78ff6b0089a3befd3a86cd895bdb9e
# Parent  4f4e4bba555a8eca004411ecddb0a82d6adc54c6
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@xxxxxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---


diff -r 4f4e4bba555a -r 04673ecb9d78 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c       Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/tests/xen-access/xen-access.c       Thu Mar 08 16:40:05 2012 +0000
@@ -269,6 +269,11 @@
                    (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 )
diff -r 4f4e4bba555a -r 04673ecb9d78 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/xenpaging/xenpaging.c       Thu Mar 08 16:40:05 2012 +0000
@@ -416,6 +416,11 @@
                    (mem_event_sring_t *)paging->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, 
+                    paging->mem_event.domain_id, 1, 0, &ring_pfn) )
+        PERROR("Failed to remove ring from guest physmap");
+
     /* Get max_pages from guest if not provided via cmdline */
     if ( !paging->max_pages )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.