[U-Boot-Users] [PATCH 13/13] [new uImage] Return error on image move/uncompress overwrites

Wolfgang Denk wd at denx.de
Sat Jan 12 02:26:36 CET 2008


In message <20080111143054.8025.33808.stgit at 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?

> +			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?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Gates in my computer are AND, OR and NOT; they are not Bill.




More information about the U-Boot mailing list