[prev in list] [next in list] [prev in thread] [next in thread]
List: xen-cvs
Subject: [Xen-changelog] Fix infinite recursion loop in get_page_type()
From: "Xen patchbot-3.0-testing" <patchbot-3.0-testing () lists ! xensource ! com>
Date: 2006-05-30 22:14:25
Message-ID: E1FlCTp-0005U7-PG () xenbits ! xensource ! com
[Download RAW message or body]
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 18e8e613deb9050de02eb8ba9138185e33240e7f
# Parent 10602076065759c58d9cc1be0c04241325539c8b
Fix infinite recursion loop in get_page_type() error path.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 10183:c43080e63545c2c9ba101fd8864b5aacc5d666e2
xen-unstable date: Tue May 30 18:11:34 2006 +0100
---
xen/arch/x86/mm.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff -r 106020760657 -r 18e8e613deb9 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri May 26 13:55:33 2006 +0100
+++ b/xen/arch/x86/mm.c Tue May 30 18:14:05 2006 +0100
@@ -1497,12 +1497,18 @@ int get_page_type(struct page_info *page
{
if ( unlikely((x & PGT_type_mask) != (type & PGT_type_mask) ) )
{
- if ( current->domain == page_get_owner(page) )
+ if ( (current->domain == page_get_owner(page)) &&
+ ((x & PGT_type_mask) == PGT_writable_page) )
{
/*
* This ensures functions like set_gdt() see up-to-date
* type info without needing to clean up writable p.t.
- * state on the fast path.
+ * state on the fast path. We take this path only
+ * when the current type is writable because:
+ * 1. It's the only type that this path can decrement.
+ * 2. If we take this path more liberally then we can
+ * enter a recursive loop via get_page_from_l1e()
+ * during pagetable revalidation.
*/
LOCK_BIGLOCK(current->domain);
cleanup_writable_pagetable(current->domain);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic