]> git.ipfire.org Git - thirdparty/grub.git/commit
kern/fs: Fix possible integer overflow in i386-pc mode with large partitions
authorMaxim Fomin <maxim@fomin.one>
Wed, 28 Dec 2022 17:40:06 +0000 (17:40 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 10 Jan 2023 15:37:11 +0000 (16:37 +0100)
commit1a241e050652472efa62b2b36ad2fa7f82427b83
treec50a0ba079268f8bfe1a65eb5d9a565e370e0afa
parent4ba977777cb146c7a2a7ce3fb3c285e1b6cdf952
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>
grub-core/kern/fs.c