From: Wolfgang Denk Date: Sat, 12 Jan 2008 02:26:36 +0100 Subject: [U-Boot-Users] [PATCH 13/13] [new uImage] Return error on image move/uncompress overwrites In-Reply-To: Your message of "Fri, 11 Jan 2008 15:31:00 +0100." <20080111143054.8025.33808.stgit@hekate.izotz.org> Message-ID: <20080112012637.08ACC24656@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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? > + 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.