[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Fix possible integer overflow in i386-pc mode with large
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v2] Fix possible integer overflow in i386-pc mode with large partitions |
Date: |
Mon, 9 Jan 2023 16:04:50 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Wed, Dec 28, 2022 at 05:40:06PM +0000, Maxim Fomin wrote:
> From f9e2970e5731f13fdc506dbf5c722fd24b20a1aa Mon Sep 17 00:00:00 2001
> From: Maxim Fomin <maxim@fomin.one>
> Date: Wed, 28 Dec 2022 20:25:05 +0000
> Subject: [PATCH v2] 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.
> ---
> grub-core/kern/fs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c
> index b9508296d..7ad0aaf4e 100644
> --- a/grub-core/kern/fs.c
> +++ b/grub-core/kern/fs.c
> @@ -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;
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2] Fix possible integer overflow in i386-pc mode with large partitions,
Daniel Kiper <=