Re: [Xen-devel] [PATCH v8.1 10/27] xsplice: Add helper elf routines

2016-04-20 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/20/16 6:09 PM >>> >On Mon, Apr 18, 2016 at 12:23:26AM -0600, Jan Beulich wrote: >> >>> Konrad Rzeszutek Wilk 04/18/16 7:55 AM >>> >> >> >+ if ( delta > elf->len ) >> >> >+ { >> >> >+ dprintk(XENLOG_ERR, XSPLICE "%s: Section table is past end of >> >> >payload!\n", >>

Re: [Xen-devel] [PATCH v8.1 10/27] xsplice: Add helper elf routines

2016-04-20 Thread Konrad Rzeszutek Wilk
On Mon, Apr 18, 2016 at 12:23:26AM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/18/16 7:55 AM >>> > >> >+ if ( delta > elf->len ) > >> >+ { > >> >+ dprintk(XENLOG_ERR, XSPLICE "%s: Section table is past end of > >> >payload!\n", > >> >+ elf->name); > >> >+ return -EINVAL; > >> >+ } >

Re: [Xen-devel] [PATCH v8.1 10/27] xsplice: Add helper elf routines

2016-04-17 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/18/16 7:55 AM >>> >> >+ if ( delta > elf->len ) >> >+ { >> >+ dprintk(XENLOG_ERR, XSPLICE "%s: Section table is past end of payload!\n", >> >+ elf->name); >> >+ return -EINVAL; >> >+ } >> >+ >> >+ for ( i = 1; i < elf->hdr->e_shnum; i++ ) >> >+ { >> >+ delta = elf->hdr

Re: [Xen-devel] [PATCH v8.1 10/27] xsplice: Add helper elf routines

2016-04-17 Thread Konrad Rzeszutek Wilk
. snip.. > >+static int elf_resolve_sections(struct xsplice_elf *elf, const void *data) > >+{ > >+ struct xsplice_elf_sec *sec; > >+ unsigned int i; > >+ Elf_Off delta; > >+ int rc; > >+ > >+ /* xsplice_elf_load sanity checked e_shnum. */ > >+ sec = xmalloc_array(struct xsplice_elf_sec, elf->hdr->e

Re: [Xen-devel] [PATCH v8.1 10/27] xsplice: Add helper elf routines

2016-04-17 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/14/16 12:03 AM >>> >+static int elf_verify_strtab(const struct xsplice_elf_sec *sec) >+{ >+ const Elf_Shdr *s; >+ const uint8_t *contents; Considering it's a string table, perhaps better const char *? >+ s = sec->sec; >+ >+ if ( s->sh_type != SHT_STRTAB ) >+ return -