MTD - Reboot parser Fix

Vinesh Christopher vineshc at ami.com
Wed Apr 21 00:25:53 EDT 2004


Reboot FIS parser in mtd in kernel 2.6.5 has a bug. 
The parsing routine assumes that all the used Fis entries are 
contiguous and a Fis entry with 0xFF at first byte terminates 
the parsing.

Attached is a fixed source file from 2.6.5. Line 87 "break" 
changed to "continue"

-----------------------------------------------------------------
 Here is the actual scenario where the problem happens
 
 a) Initial FIS directory has 
 	Redboot
 	Redboot Config
 	FIS Directory
 	
 	Reboot and Linux MTD shows 3
 
 b) I added a new FIS entry called Install
 	Reboot and Linux MTD shows 4
 
 c) I added two more entry called zImage and initrd
 	Redboot and Linux MTD shows 6
 
 d) Deleted Install entry
 	Redboot shows 5, but Linux MTD shows 3 (Redboot, Config and FIS)
 
 What happened is in the fis directory, the 4th entry is now 
 "0xFF"nstall - 'I' of Install is replaced by 0xFF to denote it is not 
 used. Redboot MTD parser sees this and thinks it is end of FIS entries 
 and breaks out of the parse loop.
 

 Vinesh	


-------------- next part --------------
A non-text attachment was scrubbed...
Name: redboot.c
Type: application/octet-stream
Size: 4947 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20040421/44f0948e/attachment.obj 


More information about the linux-mtd mailing list