Accepting request 631907 from home:michael-chang:bsc:1105163

- Fix overflow in sector count calculation (bsc#1105163)
  * grub2-msdos-fix-overflow.patch

OBS-URL: https://build.opensuse.org/request/show/631907
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=312
This commit is contained in:
Dirk Mueller 2018-08-28 08:13:38 +00:00 committed by Git OBS Bridge
parent be7f2e5182
commit 31d76fc0f5
3 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,46 @@
Index: grub-2.02/grub-core/partmap/msdos.c
===================================================================
--- grub-2.02.orig/grub-core/partmap/msdos.c
+++ grub-2.02/grub-core/partmap/msdos.c
@@ -175,9 +175,9 @@ grub_partition_msdos_iterate (grub_disk_
e = mbr.entries + p.index;
p.start = p.offset
- + (grub_le_to_cpu32 (e->start)
+ + ((grub_disk_addr_t)grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)) - delta;
- p.len = grub_le_to_cpu32 (e->length)
+ p.len = (grub_uint64_t)grub_le_to_cpu32 (e->length)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS);
p.msdostype = e->type;
@@ -217,7 +217,7 @@ grub_partition_msdos_iterate (grub_disk_
if (grub_msdos_partition_is_extended (e->type))
{
p.offset = ext_offset
- + (grub_le_to_cpu32 (e->start)
+ + ((grub_disk_addr_t)grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
if (! ext_offset)
ext_offset = p.offset;
@@ -301,9 +301,9 @@ pc_partition_map_embed (struct grub_disk
if (!grub_msdos_partition_is_empty (e->type)
&& end > offset
- + (grub_le_to_cpu32 (e->start)
+ + ((grub_disk_addr_t)grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)))
- end = offset + (grub_le_to_cpu32 (e->start)
+ end = offset + ((grub_disk_addr_t)grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
/* If this is a GPT partition, this MBR is just a dummy. */
@@ -319,7 +319,7 @@ pc_partition_map_embed (struct grub_disk
if (grub_msdos_partition_is_extended (e->type))
{
offset = ext_offset
- + (grub_le_to_cpu32 (e->start)
+ + ((grub_disk_addr_t)grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
if (! ext_offset)
ext_offset = offset;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 23 08:37:15 UTC 2018 - mchang@suse.com
- Fix overflow in sector count calculation (bsc#1105163)
* grub2-msdos-fix-overflow.patch
-------------------------------------------------------------------
Thu Aug 9 02:48:18 UTC 2018 - mchang@suse.com

View File

@ -220,6 +220,7 @@ Patch87: 0001-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled-MMIO-da.patch
Patch88: unix-exec-avoid-atexit-handlers-when-child-exits.patch
Patch89: 0001-xfs-Accept-filesystem-with-sparse-inodes.patch
Patch90: grub2-binutils2.31.patch
Patch91: grub2-msdos-fix-overflow.patch
# Btrfs snapshot booting related patches
Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch
Patch102: grub2-btrfs-02-export-subvolume-envvars.patch
@ -515,6 +516,7 @@ swap partition while in resuming
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1