From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 2/2] xen/arm: support compressed kernels Date: Wed, 12 Aug 2015 18:00:51 +0100 Message-ID: <55CB7BC3.8090006@citrix.com> References: <1439390875-21256-2-git-send-email-stefano.stabellini@eu.citrix.com> <55CB75DE.1090102@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55CB75DE.1090102@citrix.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: Andrew Cooper , Stefano Stabellini , xen-devel@lists.xensource.com Cc: ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On 12/08/15 17:35, Andrew Cooper wrote: >> + >> +static int kernel_zimage64_compressed_probe(struct kernel_info *info, >> + paddr_t addr, paddr_t size) >> +{ >> + char *output, *input; >> + unsigned char magic[2]; >> + int rc; >> + unsigned kernel_order_in; >> + unsigned kernel_order_out; >> + paddr_t output_size; >> + >> + copy_from_paddr(magic, addr, sizeof(magic)); > > Need a size check before assuming sufficient length. (All of the arm > probe functions suffer in a similar way.) Are you sure? kernel_zimage{32,64}_probe as long as kernel_uboot_probe are checking the size before copying the magic... Regards, -- Julien Grall