]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/fs/cbfs.c: Don't probe disks of unknow size.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 10 Aug 2014 07:50:36 +0000 (09:50 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 10 Aug 2014 07:50:36 +0000 (09:50 +0200)
Fixes hang on virtualbox.

ChangeLog
grub-core/fs/cbfs.c

index ccd8ac1f145023a7f9a5334a669b168b8fd78d97..47ff3552c417068e7434c276599587fb7ed72ea0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/cbfs.c: Don't probe disks of unknow size.
+
 2014-07-08  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub.d/10_hurd.in: Make kernel list progression not fail on
index 7ad1483610aab2234599d4a8f7fd66cade23ab06..35750a0e4d9257cf4c65a6057718c0cf79a7618a 100644 (file)
@@ -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))