]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 10 Aug 2014 09:27:13 +0000 (11:27 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 10 Aug 2014 09:27:13 +0000 (11:27 +0200)
safety to avoid triggerring VirtualBox bug.

ChangeLog
grub-core/disk/i386/pc/biosdisk.c

index cab1427cd69ee2cd1be00f67cfe81423a90fb561..9e159a8da87c9aa40a3f386f2e8563a70923ddb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add
+       safety to avoid triggerring VirtualBox bug.
+
 2014-08-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/cbfs.c: Don't probe disks of unknow size.
index 1689539cdf578a9e1e617831d3f1f4bd9e4751e5..6b21525911298002a448d8770701c0b546ba3422 100644 (file)
@@ -455,6 +455,14 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk,
 {
   struct grub_biosdisk_data *data = disk->data;
 
+  /* VirtualBox fails with sectors above 2T on CDs.
+     Since even BD-ROMS are never that big anyway, return error.  */
+  if ((data->flags & GRUB_BIOSDISK_FLAG_CDROM)
+      && (sector >> 32))
+    return grub_error (GRUB_ERR_OUT_OF_RANGE,
+                      N_("attempt to read or write outside of disk `%s'"),
+                      disk->name);
+
   if (data->flags & GRUB_BIOSDISK_FLAG_LBA)
     {
       struct grub_biosdisk_dap *dap;