aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2013-06-14 16:43:16 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-06-14 16:43:16 +0100
commitde9089b449d2508b1ba05590905c7ebaee00c8c4 (patch)
tree0fbdcca1b48992fb54e0008e4d7e4deb720e0fad
parent682a04488e7b3bd6c3448ab60599566eb7c6177a (diff)
downloadxen-de9089b449d2508b1ba05590905c7ebaee00c8c4.tar.gz
xen-de9089b449d2508b1ba05590905c7ebaee00c8c4.tar.bz2
xen-de9089b449d2508b1ba05590905c7ebaee00c8c4.zip
libelf/xc_dom_load_elf_symtab: Do not use "syms" uninitialised
xc_dom_load_elf_symtab (with load==0) calls elf_round_up, but it mistakenly used the uninitialised variable "syms" when calculating dom->bsd_symtab_start. This should be a reference to "elf". This change might have the effect of rounding the value differently. Previously if the uninitialised value (a single byte on the stack) was ELFCLASS64 (ie, 2), the alignment would be to 8 bytes, otherwise to 4. However, the value is calculated from dom->kernel_seg.vend so this could only make a difference if that value wasn't already aligned to 8 bytes. This is part of the fix to a security issue, XSA-55. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r--tools/libxc/xc_dom_elfloader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 031b5b6a80..e82f6e9593 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -144,7 +144,7 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
hdr = xc_dom_malloc(dom, size);
if ( hdr == NULL )
return 0;
- dom->bsd_symtab_start = elf_round_up(&syms, dom->kernel_seg.vend);
+ dom->bsd_symtab_start = elf_round_up(elf, dom->kernel_seg.vend);
}
memcpy(hdr + sizeof(int),