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-devel

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

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix null pointer dereference in xen_guest_lookup()
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Sat, 26 Aug 2006 16:22:26 -0600
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 26 Aug 2006 15:22:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: OSLO R&D
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
  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

<Prev in Thread] Current Thread [Next in Thread>