fix null pointer dereference in xen_guest_lookup()
PATCH 1/1 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 <[email protected]>
---
tools/libxc/xc_load_elf.c +3 -0
@@ -93,6 +93,9 @@ static const char *xen_guest_lookup(struconst char *fallback;const char *p; +if ( !dsi->__xen_guest_string ) +return NULL ; +if ( type >sizeof (xenguest_fallbacks) )return NULL ;
xen/common/elf.c +3 -0
@@ -49,6 +49,9 @@ static const char *xen_guest_lookup(struconst char *fallback;const char *p; +if ( !dsi->__xen_guest_string ) +return NULL ; +if ( type >sizeof (xenguest_fallbacks) )return NULL ;
Quoted 4 lines · Alex Williamson
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_stringprior to using it. Please apply. Thanks,
Committed, thank you.
Ian.