From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aravind Gopalakrishnan Subject: Re: [PATCH V2] x86, amd_ucode: Support multiple container files appended together Date: Wed, 25 Jun 2014 09:54:52 -0500 Message-ID: <53AAE2BC.5080203@amd.com> References: <1403555119-12793-1-git-send-email-aravind.gopalakrishnan@amd.com> <53A94389020000780001CADA@mail.emea.novell.com> <53A9FED0.7090203@amd.com> <53AAC4CF020000780001D2A2@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53AAC4CF020000780001D2A2@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: boris.ostrovsky@oracle.com, keir@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 6/25/2014 5:47 AM, Jan Beulich wrote: >>>> + return 0; >>>> +} >>>> + >>>> +static int container_fast_forward(const void *data, size_t size_left, >> size_t *offset) >>>> +{ >>>> + size_t size; >>>> + uint32_t *header; >>>> + >>>> + while ( size_left ) >>>> + { >>>> + header = (uint32_t *) (data + *offset); >>> Pointless (and wrong, as it discards the const qualifier) cast. >> Ok. I have removed this cast (and as a consequence *header) entirely. >> Also need - >> if ( size_left < 0 ) check. Reason- >> With offset value being advanced aggressively in 'install_equiv_cpu_table', >> It could be that we go over the bufsize. This situation will be caught here. > Except that size_left is of unsigned type, i.e. will never be < 0. > > Oh. Missed that. Shall fix this. Thanks, -Aravind.