Skip to contentSkip to conversation

X server crashes Xen on xeno-unstable.bk

PATCH New Leendert van Doorn 1 participant 1 message Jan 6, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 X server crashes Xen on xeno-unstable.bk

[My platform is a VMX machine, but this is a generic problem in xeno-unstable.bk. I use FC3 as a base and some onboard graphics controller chipset]

Starting an X server on xeno-unstable.bk causes Xen to crash with a page fault generated in Xen. It turns out that the fault is generated by put_page_from_l1e().

The culprit is the following dereference:

     struct domain   *e = page->u.inuse.domain;

Where the value of page is undefined if the condition

     if ( !(l1v & _PAGE_PRESENT) || !pfn_is_ram(pfn) )

does hold. Unfortunately, this condition is checked after the dereference.

The fix is straightforward, move the dereference after the condition test.

Leendert

xen/arch/x86/memory.c renamed from xen/arch/x86/memory.c.orig +2 -1
@@ -467,11 +467,12 @@
     unsigned long    l1v  = l1_pgentry_val(l1e);
     unsigned long    pfn  = l1_pgentry_to_pagenr(l1e);
     struct pfn_info *page = &frame_table[pfn];
-    struct domain   *e = page->u.inuse.domain;
+    struct domain   *e;
 
     if ( !(l1v & _PAGE_PRESENT) || !pfn_is_ram(pfn) )
         return;
 
+    e = page->u.inuse.domain;
     if ( unlikely(e != d) )
     {
         /*

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt