diff --git a/ChangeLog b/ChangeLog index 55fc31858..f9e7a4b6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-22 Vladimir Serbinenko + + * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Ensure + at compile time that enough of scratch size is available. + 2013-11-22 Vladimir Serbinenko * grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment. diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c index 7458c7a0f..1689539cd 100644 --- a/grub-core/disk/i386/pc/biosdisk.c +++ b/grub-core/disk/i386/pc/biosdisk.c @@ -426,6 +426,10 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->total_sectors = total_sectors; /* Limit the max to 0x7f because of Phoenix EDD. */ disk->max_agglomerate = 0x7f >> GRUB_DISK_CACHE_BITS; + COMPILE_TIME_ASSERT ((0x7f >> GRUB_DISK_CACHE_BITS + << (GRUB_DISK_SECTOR_BITS + GRUB_DISK_CACHE_BITS)) + + sizeof (struct grub_biosdisk_dap) + < GRUB_MEMORY_MACHINE_SCRATCH_SIZE); disk->data = data;