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

2016-04-27 Thread Konrad Rzeszutek Wilk
> > v10: > > - Change the check against 64 to be against SHN_LORESERVE > > So we're moving between the extremes, and (as said in reply to v9) > I think we really want to be somewhere in the middle. > > Andrew? Ross? I stuck 1024 in there with a comment saying it is arbitrary. Andrew was ok wi

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

2016-04-27 Thread Konrad Rzeszutek Wilk
On Wed, Apr 27, 2016 at 01:27:05AM -0600, Jan Beulich wrote: > >>> On 27.04.16 at 03:59, wrote: > >> > +static int xsplice_header_check(const struct xsplice_elf *elf) > >> > +{ > >> > +const Elf_Ehdr *hdr = elf->hdr; > >> > + > >> > +if ( sizeof(*elf->hdr) > elf->len ) > >> > +{ > >> >

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

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 06:06, wrote: >> > +static int xsplice_header_check(const struct xsplice_elf *elf) >> > +{ > ..snip.. >> > +if ( elf->hdr->e_shnum > 64 ) >> > +{ >> > +dprintk(XENLOG_ERR, XSPLICE "%s: Too many (%u) sections!\n", >> > +elf->name, elf->hdr->e_shnu

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

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 03:59, wrote: >> > +static int xsplice_header_check(const struct xsplice_elf *elf) >> > +{ >> > +const Elf_Ehdr *hdr = elf->hdr; >> > + >> > +if ( sizeof(*elf->hdr) > elf->len ) >> > +{ >> > +dprintk(XENLOG_ERR, XSPLICE "%s: Section header is bigger than > p

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

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int elf_resolve_sections(struct xsplice_elf *elf, const void *data) > > +{ ..snip.. > > +/* e_shoff and e_shnum overflow checks are done in > > xsplice_header_check. */ > > +delta = elf->hdr->e_shoff + elf->hdr->e_shnum * elf->hdr->e_shentsize; > > The added comment just helps

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

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int xsplice_header_check(const struct xsplice_elf *elf) > > +{ > > +const Elf_Ehdr *hdr = elf->hdr; > > + > > +if ( sizeof(*elf->hdr) > elf->len ) > > +{ > > +dprintk(XENLOG_ERR, XSPLICE "%s: Section header is bigger than > > payload!\n", > > +elf->n

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

2016-04-26 Thread Jan Beulich
>>> On 25.04.16 at 17:34, wrote: > From: Ross Lagerwall > > Add Elf routines and data structures in preparation for loading an > xSplice payload. > > We make an assumption that the max number of sections an ELF payload > can have is 64. We can in future make this be dependent on the > names of

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

2016-04-26 Thread Jan Beulich
>>> On 26.04.16 at 12:05, wrote: > On 04/25/2016 04:34 PM, Konrad Rzeszutek Wilk wrote: > snip >> +static int xsplice_header_check(const struct xsplice_elf *elf) >> +{ >> +const Elf_Ehdr *hdr = elf->hdr; >> + >> +if ( sizeof(*elf->hdr) > elf->len ) >> +{ >> +dprintk(XENLOG_ERR,

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

2016-04-26 Thread Ross Lagerwall
On 04/25/2016 04:34 PM, Konrad Rzeszutek Wilk wrote: snip +static int xsplice_header_check(const struct xsplice_elf *elf) +{ +const Elf_Ehdr *hdr = elf->hdr; + +if ( sizeof(*elf->hdr) > elf->len ) +{ +dprintk(XENLOG_ERR, XSPLICE "%s: Section header is bigger than payload!\n",

[Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-25 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add Elf routines and data structures in preparation for loading an xSplice payload. We make an assumption that the max number of sections an ELF payload can have is 64. We can in future make this be dependent on the names of the sections and verifying against a list, but for