]> git.ipfire.org Git - thirdparty/grub.git/commit
osdep/linux: Convert partition start to disk sector length
authorMihai Moldovan <ionic@ionic.de>
Thu, 6 Sep 2018 14:16:39 +0000 (16:16 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 27 Sep 2018 12:53:32 +0000 (14:53 +0200)
commit5b9308aff04594fd9f351949fdc2c7e6c2da1a2b
tree1a1b4a87d7d835c25f20c4a0b86881ff26bc64ad
parent8b467844e11170077c8ca727c39d2bd36eeb5f08
osdep/linux: Convert partition start to disk sector length

When reading data off a disk, sector values are based on the disk sector
length.

Within grub_util_fd_open_device(), the start of the partition was taken
directly from grub's partition information structure, which uses the
internal sector length (currently 512b), but never transformed to the
disk's sector length.

Subsequent calculations were all wrong for devices that have a diverging
sector length and the functions eventually skipped to the wrong stream
location, reading invalid data.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/osdep/linux/hostdisk.c