diff --git a/ChangeLog b/ChangeLog index cab1427cd..9e159a8da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-08-10 Vladimir Serbinenko + + * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Add + safety to avoid triggerring VirtualBox bug. + 2014-08-10 Vladimir Serbinenko * grub-core/fs/cbfs.c: Don't probe disks of unknow size. diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c index 1689539cd..6b2152591 100644 --- a/grub-core/disk/i386/pc/biosdisk.c +++ b/grub-core/disk/i386/pc/biosdisk.c @@ -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;