From: "Jan Beulich" Subject: Re: [PATCH v1 07/11] xsplice: Implement payload loading Date: Thu, 05 Nov 2015 05:13:35 -0700 Message-ID: <563B55FF02000078000B21F4@prv-mh.provo.novell.com> References: <1446574568-9644-1-git-send-email-ross.lagerwall@citrix.com> <1446574568-9644-7-git-send-email-ross.lagerwall@citrix.com> <20151104222118.GA25657@char.us.oracle.com> <563B3F0902000078000B20FF@prv-mh.provo.novell.com> <563B42D9.3080208@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <563B42D9.3080208@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Lagerwall , Konrad Rzeszutek Wilk Cc: Andrew Cooper , Stefano Stabellini , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 05.11.15 at 12:51, wrote: > On 11/05/2015 10:35 AM, Jan Beulich wrote: >>>>> On 04.11.15 at 23:21, wrote: >>>> +int xsplice_perform_rela(struct xsplice_elf *elf, >>>> + struct xsplice_elf_sec *base, >>>> + struct xsplice_elf_sec *rela) >>>> +{ >>>> + Elf64_Rela *r; >>>> + int symndx, i; >>> >>> unsigned int >>> >>>> + uint64_t val; >>>> + uint8_t *dest; >>>> + >>> >>> Can you double check that rela->sec-sh_entsize is not zero first? >> >> Perhaps not just not zero, but at least a certain minimum? Or even >> equaling some sizeof()? >> > > Well it only makes sense if rela->sec-sh_entsize == sizeof(Elf64_Rela) > so that is what I shall check for. The question whether to use == or >= really depends on whether we expect (theoretical) additions to the structure to be backwards compatible. Jan