kern/fs: Fix possible integer overflow in i386-pc mode with large partitions

The i386-pc mode supports MBR partition scheme where maximum partition
size is 2 TiB. In case of large partitions left shift expression with
unsigned long int "length" object may cause integer overflow making
calculated partition size less than true value. This issue is fixed by
increasing the size of "length" integer type.

Signed-off-by: Maxim Fomin <maxim@fomin.one>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Maxim Fomin 2022-12-28 17:40:06 +00:00 committed by Daniel Kiper
parent 4ba977777c
commit 1a241e0506

View File

@ -130,7 +130,7 @@ grub_fs_probe (grub_device_t device)
struct grub_fs_block
{
grub_disk_addr_t offset;
unsigned long length;
grub_disk_addr_t length;
};
static grub_err_t