WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: clear page content after evict
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 11 Oct 2011 15:11:09 +0100
Delivery-date: Tue, 11 Oct 2011 07:12:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpaging: clear page content after evict, Xen patchbot-unstable <=