From: Vladimir Serbinenko Date: Sun, 10 Aug 2014 07:50:36 +0000 (+0200) Subject: * grub-core/fs/cbfs.c: Don't probe disks of unknow size. X-Git-Tag: 2.02-beta3~633 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=33f6ce671f984465e0f8f9c96927c087b6d0c1a1;p=thirdparty%2Fgrub.git * grub-core/fs/cbfs.c: Don't probe disks of unknow size. Fixes hang on virtualbox. --- diff --git a/ChangeLog b/ChangeLog index ccd8ac1f1..47ff3552c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-08-10 Vladimir Serbinenko + + * grub-core/fs/cbfs.c: Don't probe disks of unknow size. + 2014-07-08 Colin Watson * util/grub.d/10_hurd.in: Make kernel list progression not fail on diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c index 7ad148361..35750a0e4 100644 --- a/grub-core/fs/cbfs.c +++ b/grub-core/fs/cbfs.c @@ -149,6 +149,9 @@ grub_cbfs_mount (grub_disk_t disk) grub_off_t header_off; struct cbfs_header head; + if (grub_disk_get_size (disk) == GRUB_DISK_SIZE_UNKNOWN) + goto fail; + if (grub_disk_read (disk, grub_disk_get_size (disk) - 1, GRUB_DISK_SECTOR_SIZE - sizeof (ptr), sizeof (ptr), &ptr))