mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: basti@linux-source.de
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] arch/arm/lib/bootm: fix length check of kernel image
Date: Tue, 22 Jul 2014 21:45:28 +0200	[thread overview]
Message-ID: <20140722194528.GC23235@pengutronix.de> (raw)
In-Reply-To: <94dc023fe4dffc56144a4d26532aff05@linux-source.de>

On Tue, Jul 22, 2014 at 11:14:26AM +0200, basti@linux-source.de wrote:
> Hi Sascha,

(Adding back the list to Cc)

> 
> >>Signed-off-by: Sebastian Block <basti@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'.
> 
> I run into trouble with it, caused by variable end contains memory
> address of the image not the size as returned by read_full.

Hm, this must have something to do with your kernel configuration. Maybe
you have CONFIG_ARM_PATCH_PHYS_VIRT disabled in your kernel.

Anyway, applied this patch to current master.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2014-07-22 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 10:43 basti
2014-07-22  5:38 ` Sascha Hauer
2014-07-22  7:38   ` Lucas Stach
     [not found]   ` <94dc023fe4dffc56144a4d26532aff05@linux-source.de>
2014-07-22 19:45     ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140722194528.GC23235@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=basti@linux-source.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox