public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] part_dos: check status flags of partitions
@ 2009-09-28 10:04 Daniel Mack
  2009-10-03  5:05 ` Daniel Mack
  2009-10-18 20:50 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Mack @ 2009-09-28 10:04 UTC (permalink / raw)
  To: u-boot

The current fatload code has a problem together with the way the DOS
partition parser is implemented.

This hit me when I tried to load a file from a USB stick which had no
partition table but a FAT16 directly written to the first sector.

With such an environment, get_partition_info_extended() still finds a
valid partition at the first sector since the 0x55aa magic is valid for
both the MBR and the FAT boot sector.

As a result, part_offset in fs/fat/fat.c is then set to some ridiculous
value and the code searching for the directory entry gets lots in an
endless loop.

The fix is quite simple though - we just need to check the status field
of the partitions more stricly. According to the specs, it may only
contain 0x00 and 0x80. If get_partition_info() fails for this case, the
fatload code falls back to the assumption that there is no partition
table and does the right thing then.

Please consider applying the following patch.

Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-18 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28 10:04 [U-Boot] [PATCH] part_dos: check status flags of partitions Daniel Mack
2009-10-03  5:05 ` Daniel Mack
2009-10-03 23:33   ` Wolfgang Denk
2009-10-18 20:50 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox