[PATCH] arch/arm/lib/bootm: fix length check of kernel image

Lucas Stach l.stach at pengutronix.de
Tue Jul 22 00:38:44 PDT 2014


Am Dienstag, den 22.07.2014, 07:38 +0200 schrieb Sascha Hauer:
> Hi Sebastian,
> 
> On Mon, Jul 21, 2014 at 12:43:13PM +0200, basti at linux-source.de wrote:
> > Signed-off-by: Sebastian Block <basti at linux-source.de>
> > ---
> >  arch/arm/lib/bootm.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index 4896d01..d9b9111 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -314,7 +314,7 @@ static int do_bootz_linux(struct image_data *data)
> >  			image_size - sizeof(*header));
> >  	if (ret < 0)
> >  		goto err_out;
> > -	if (ret < end - sizeof(*header)) {
> > +	if (ret < image_size - sizeof(*header)) {
> 
> Did this cause any real trouble? I was quite surprised when I saw that
> patch. After a test I saw that for me 'image_size' has the same value as
> 'end'.
> 
> The patch is obviously correct and will be applied, I'm just not sure if
> it's an important fix or a cleanup change.
> 
I don't think this qualifies as a critical fix, as before the
introduction of this 'image_size' variable we always used 'end' as the
size of the image without running into any problems. So I think this is
only a correctness fix.

Regards,
Lucas

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |




More information about the barebox mailing list