summaryrefslogtreecommitdiff
path: root/dts
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-10-15 20:43:42 +0200
committerTom Rini <trini@konsulko.com>2019-10-31 07:22:53 -0400
commit34856b0f1c4e56ad63879b9cdef71302225423cd (patch)
tree0397e9fc6b3d91ff8a0b8572f0d1d7dcf2f1ff5c /dts
parent79c84de4689b1c22be3ccac8914307daa38b0bd8 (diff)
disk: part_dos: correctly detect DOS PBR
The signature 0x55 0xAA in bytes 510 and 511 of the first sector can either indicate a DOS partition table of the first sector of a FAT file system. The current code tries to check if the partition table is valid by looking at the boot indicator of the partition entries. But first of all it does not count from 0 to 3 but only from 0 to 2. And second it misses to increment the pointer for the partition entry. If it is a FAT file system can be discovered by looking for the text 'FAT' at offset 0x36 or 'FAT32' at offset 0x52. In a DOS PBR there are no partition entries, so those bytes are undefined. Don't require the byte at offset 0x1BE to differ from 0x00 and 0x80. With the patch the logic is changed as follows: If the partition table has either an invalid boot flag for any partition or has no partition at all, check if the first sector is a DOS PBR by looking at the FAT* signature. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'dts')
0 files changed, 0 insertions, 0 deletions