public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marian Balakowicz <m8@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 13/13] [new uImage] Return error on image move/uncompress overwrites
Date: Tue, 15 Jan 2008 12:15:55 +0100	[thread overview]
Message-ID: <478C95EB.4000806@semihalf.com> (raw)
In-Reply-To: <20080112012637.08ACC24656@gemini.denx.de>

Wolfgang Denk wrote:
> In message <20080111143054.8025.33808.stgit@hekate.izotz.org> you wrote:
>> Check for overwrites during image move/uncompress, return with error
>> when the original image gets corrupted. Report clear message to the user
>> and prevent further troubles when pointer to the corrupted images is passed
>> to do_bootm_linux routine.
> 
> Does this really work? With compressed images?

Yes it does, I tested it with compressed linux kernel images.

>> +			image_start = (ulong)fdt_hdr;
>> +			image_end = image_get_image_end(fdt_hdr);
>> +
>> +			load_start = image_get_load(fdt_hdr);
>> +			load_end = load_start + image_get_data_size(fdt_hdr);
>> +
>> +			if ((load_start < image_end) && (load_end > image_start)) {
>>  				puts ("ERROR: fdt overwritten - "
>>  					"must RESET the board to recover.\n");
>>  				do_reset (cmdtp, flag, argc, argv);
> 
> Me thinks that load_end gives a value which does not take into
> account that the loaded, uncompressed image will be much bigger than
> image_get_data_size() tells - or am I missing something?

That part of the patch deals with the FDT blob image. Compressed blobs
are not supported in the current code, so no decompression happens and
we can use image_get_data_size(). BTW, this particular overwrite check
is already present in the current U-boot.

Cheers,
m.

  reply	other threads:[~2008-01-15 11:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 14:27 [U-Boot-Users] [PATCH 00/13] new uImage patchset1 - cleanup Marian Balakowicz
2008-01-11 14:27 ` [U-Boot-Users] [PATCH 01/13] Add missing cmd_ximg.o to common/Makefile Marian Balakowicz
2008-01-11 14:28 ` [U-Boot-Users] [PATCH 02/13] [new uImage] Define a API for image handling operations Marian Balakowicz
2008-01-12  0:48   ` Wolfgang Denk
2008-01-15 10:35     ` Marian Balakowicz
2008-01-15 22:05       ` Wolfgang Denk
2008-01-12  0:50   ` Wolfgang Denk
2008-01-15 10:37     ` Marian Balakowicz
2008-01-12  1:04   ` Wolfgang Denk
2008-01-15 10:58     ` Marian Balakowicz
2008-01-11 14:28 ` [U-Boot-Users] [PATCH 03/13] [new uImage] Move PPC do_bootm_linux() to lib_ppc/ppc_linux.c Marian Balakowicz
2008-01-12  1:08   ` Wolfgang Denk
2008-01-15 11:02     ` Marian Balakowicz
2008-01-11 14:28 ` [U-Boot-Users] [PATCH 04/13] [new uImage] Cleanup OF/FDT #if/#elif/#endif use in do_bootm_linux() Marian Balakowicz
2008-01-11 16:26   ` Jerry Van Baren
2008-01-11 16:48     ` Jon Loeliger
2008-01-11 22:39       ` Joe Hamman
2008-01-11 16:59     ` Kim Phillips
2008-01-11 17:32       ` Jerry Van Baren
2008-01-15 10:21     ` Marian Balakowicz
2008-01-11 14:29 ` [U-Boot-Users] [PATCH 05/13] [new uImage] Move gunzip() common code to common/gunzip.c Marian Balakowicz
2008-01-11 14:29 ` [U-Boot-Users] [PATCH 06/13] [new uImage] Move CHUNKSZ definition to image.h Marian Balakowicz
2008-01-11 14:29 ` [U-Boot-Users] [PATCH 07/13] [new uImage] Remove I386 uImage fake_header() routine Marian Balakowicz
2008-01-11 14:29 ` [U-Boot-Users] [PATCH 08/13] [new uImage] Fix uImage header pointer use in i386 do_bootm_linux() Marian Balakowicz
2008-01-11 14:29 ` [U-Boot-Users] [PATCH 09/13] [new uImage] Fix FDT header verification in PPC do_boot_linux() routine Marian Balakowicz
2008-01-11 14:30 ` [U-Boot-Users] [PATCH 10/13] [new uImage] Add memmove_wd() common routine Marian Balakowicz
2008-01-11 14:30 ` [U-Boot-Users] [PATCH 11/13] [new uImage] Coding style cleanup - part 1 Marian Balakowicz
2008-01-12  1:18   ` Wolfgang Denk
2008-01-12  4:07     ` Larry Johnson
2008-01-15 11:04     ` Marian Balakowicz
2008-01-11 14:30 ` [U-Boot-Users] [PATCH 12/13] [new uImage] Cleanup image header pointer use in bootm code Marian Balakowicz
2008-01-11 14:31 ` [U-Boot-Users] [PATCH 13/13] [new uImage] Return error on image move/uncompress overwrites Marian Balakowicz
2008-01-12  1:26   ` Wolfgang Denk
2008-01-15 11:15     ` Marian Balakowicz [this message]
2008-01-11 14:47 ` [U-Boot-Users] [PATCH 00/13] new uImage patchset1 - cleanup Stefan Roese
2008-01-11 16:32   ` Jerry Van Baren
2008-01-11 23:48     ` Wolfgang Denk
2008-01-11 19:35   ` Wolfgang Denk
2008-01-12  0:54 ` Wolfgang Denk
2008-01-15 10:06   ` Marian Balakowicz

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=478C95EB.4000806@semihalf.com \
    --to=m8@semihalf.com \
    --cc=u-boot@lists.denx.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