aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_dom_elfloader.c
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2013-06-14 16:39:34 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-06-14 16:39:34 +0100
commitb5a869209998fedadfe205d37addbd50a802998b (patch)
tree4999ff71260c57b36a0d60ee86f7c2e3e05bab63 /tools/libxc/xc_dom_elfloader.c
parent53bfcf585b09eb4ac2240f89d1ade77421cd2451 (diff)
downloadxen-b5a869209998fedadfe205d37addbd50a802998b.tar.gz
xen-b5a869209998fedadfe205d37addbd50a802998b.tar.bz2
xen-b5a869209998fedadfe205d37addbd50a802998b.zip
libxc: Fix range checking in xc_dom_pfn_to_ptr etc.
* Ensure that xc_dom_pfn_to_ptr (when called with count==0) does not return a previously-allocated block which is entirely before the requested pfn (!) * Provide a version of xc_dom_pfn_to_ptr, xc_dom_pfn_to_ptr_retcount, which provides the length of the mapped region via an out parameter. * Change xc_dom_vaddr_to_ptr to always provide the length of the mapped region and change the call site in xc_dom_binloader.c to check it. The call site in xc_dom_load_elf_symtab will be corrected in a forthcoming patch, and for now ignores the returned length. This is part of the fix to a security issue, XSA-55. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> v5: This patch is new in v5 of the series.
Diffstat (limited to 'tools/libxc/xc_dom_elfloader.c')
-rw-r--r--tools/libxc/xc_dom_elfloader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c
index 65838597ef..bc92302e10 100644
--- a/tools/libxc/xc_dom_elfloader.c
+++ b/tools/libxc/xc_dom_elfloader.c
@@ -128,10 +128,11 @@ static int xc_dom_load_elf_symtab(struct xc_dom_image *dom,
if ( load )
{
+ size_t allow_size; /* will be used in a forthcoming XSA-55 patch */
if ( !dom->bsd_symtab_start )
return 0;
size = dom->kernel_seg.vend - dom->bsd_symtab_start;
- hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start);
+ hdr = xc_dom_vaddr_to_ptr(dom, dom->bsd_symtab_start, &allow_size);
*(int *)hdr = size - sizeof(int);
}
else