[PATCH] use of uninitialized stack buffer in crl bootldr

From: Yann Dirson <ydirson_at_altern.org>
Date: Tue, 29 Apr 2008 20:21:12 -0000

Hi all,

While trying to boot a kernel loaded through ymodem in my h3950, I was
hit by this problem: the kernel gets a garbage parameter inserted in
command-line after parameters from the "linuxargs" setting.

Quite upsetingly, it did not occur at first for a couple of
unsuccessful boots panicking for a rootfs, but only after I
successfully booted using an initrd (which is surely what it got
previously unnoticed). After that boot I consistently got a garbage
parameter added by bootldr after my args.

It took me to dive into the code to find the cause: the use of
uninitialized stack buffer in command_boot_addr, which also occurs in
command_boot_flash.

For those without a jtag at hand not willing to risk bricking their
ipaq, there is fortunately a workaround to this: run "boot jffs2" or
"boot jffs" (so the buffer gets reset), but with a rootfs linux won't
find (so the buffer does not get overwritten again by the running OS).

Here is a patch - which I could not test because of lack of a jtag
probe. It is the trivial port of the same fix already in
command_boot_(jffs|jffs2).

I don't know if anyone still commits any fixes to the bootldr cvs
those days. If anyone would have a suitable jtag hardware to donate,
I'd be glad to test this, and maybe dive into other things for this
hardware.

Best regards,

-- 
Yann.
Received on Tue Apr 29 2008 - 16:21:12 EDT

This archive was generated by hypermail 2.2.0 : Thu May 22 2008 - 07:17:08 EDT