From: Wolfgang Denk Date: Fri, 05 Apr 2013 18:21:03 +0200 Subject: [U-Boot] env: fix potential stack overflow in environment functions In-Reply-To: <515EED36.9090305@gmail.com> References: <1363987581-28050-1-git-send-email-robherring2@gmail.com> <20130403153014.GF7035@bill-the-cat> <20130405111710.8C04C200589@gemini.denx.de> <515EED36.9090305@gmail.com> Message-ID: <20130405162103.18C3F20063A@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 Dear Rob Herring, In message <515EED36.9090305@gmail.com> you wrote: > > The stack size limit only comes into play when bootm runs and starts > moving initrd and dtb to high addresses below the stack. At that point, > the stack size does become limited because only 4KB (recently increase > from 1KB) of space is reserved. So I had this in mind when I started BTW - the ARM code is simply broken - see "arch/arm/lib/bootm.c": 74 lmb_reserve(lmb, sp, 75 gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp); What if we have more than one memory bank? Then the computation above is pretty much random... 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 It is more rational to sacrifice one life than six. -- Spock, "The Galileo Seven", stardate 2822.3