Alex Williamson
2006-Aug-26 22:22 UTC
[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@hp.com> --- 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@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2006-Aug-27 05:57 UTC
[Xen-devel] Re: [PATCH] fix null pointer dereference in xen_guest_lookup()
On Sat, 2006-08-26 at 16:22 -0600, Alex Williamson wrote:> 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,Committed, thank you. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel