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

[Xen-changelog] [xen-unstable] xenpaging: clear page content after evict



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1318326388 -3600
# Node ID 1185ae04b5aad429fd68d1872f404791df627965
# Parent  b8b413d8b2df61b3b3184003ae660a18d01bbae3
xenpaging: clear page content after evict

If the guest happens to read from the gfn while xenpaging is in the process of
evicting the page, the guest may read zeros instead of actual data.
Also if eviction fails the page content will be corrupted and xenpaging wont
attempt to restore the page.

Remove page scrubbing from pager and do it after successful eviction.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
Committed-by: Tim Deegan <tim@xxxxxxx>
---


diff -r b8b413d8b2df -r 1185ae04b5aa tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Mon Oct 10 16:49:48 2011 +0100
+++ b/tools/xenpaging/xenpaging.c       Tue Oct 11 10:46:28 2011 +0100
@@ -455,9 +455,6 @@
         goto out;
     }
 
-    /* Clear page */
-    memset(page, 0, PAGE_SIZE);
-
     munmap(page, PAGE_SIZE);
 
     /* Tell Xen to evict page */
diff -r b8b413d8b2df -r 1185ae04b5aa xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Mon Oct 10 16:49:48 2011 +0100
+++ b/xen/arch/x86/mm/p2m.c     Tue Oct 11 10:46:28 2011 +0100
@@ -748,6 +748,9 @@
     set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_ram_paged, a);
     audit_p2m(p2m, 1);
 
+    /* Clear content before returning the page to Xen */
+    scrub_one_page(page);
+
     /* Put the page back so it gets freed */
     put_page(page);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.