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

[Xen-devel] [PATCH] fix null pointer dereference in xen_guest_lookup()



  The latest ELF changes have a null pointer dereference bug when you
have neither an elf notes section nor a __xen_guest_string.  This patch
checks for the existence of the __xen_guest_string prior to using it.
Please apply.  Thanks,

        Alex

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---

diff -r 2bc5796fbfcc tools/libxc/xc_load_elf.c
--- a/tools/libxc/xc_load_elf.c Sat Aug 26 14:44:47 2006 -0600
+++ b/tools/libxc/xc_load_elf.c Sat Aug 26 16:13:10 2006 -0600
@@ -93,6 +93,9 @@ static const char *xen_guest_lookup(stru
     const char *fallback;
     const char *p;
 
+    if ( !dsi->__xen_guest_string )
+        return NULL;
+
     if ( type > sizeof(xenguest_fallbacks) )
         return NULL;
 
diff -r 2bc5796fbfcc xen/common/elf.c
--- a/xen/common/elf.c  Sat Aug 26 14:44:47 2006 -0600
+++ b/xen/common/elf.c  Sat Aug 26 16:13:10 2006 -0600
@@ -49,6 +49,9 @@ static const char *xen_guest_lookup(stru
     const char *fallback;
     const char *p;
 
+    if ( !dsi->__xen_guest_string )
+        return NULL;
+
     if ( type > sizeof(xenguest_fallbacks) )
         return NULL;
 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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