From 6b04cf5353ec2e9eb41367654704a09b91343ab0 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 21 Jul 2019 09:31:13 +0200 Subject: [PATCH] grub: update to 2.04. Close #9023 Close #4436 --- ...ix-packed-not-aligned-error-on-GCC-8.patch | 72 ------------------- srcpkgs/grub/patches/CVE-2015-8370.patch | 47 ------------ .../patches/grub-mkimage-R_X86_64_PLT32.patch | 33 --------- srcpkgs/grub/patches/mkconfig_zfs.patch | 12 ---- ...fnet-init-structs-in-bootpath-parser.patch | 40 ----------- srcpkgs/grub/template | 8 +-- 6 files changed, 4 insertions(+), 208 deletions(-) delete mode 100644 srcpkgs/grub/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch delete mode 100644 srcpkgs/grub/patches/CVE-2015-8370.patch delete mode 100644 srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch delete mode 100644 srcpkgs/grub/patches/mkconfig_zfs.patch delete mode 100644 srcpkgs/grub/patches/ofnet-init-structs-in-bootpath-parser.patch diff --git a/srcpkgs/grub/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch b/srcpkgs/grub/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch deleted file mode 100644 index b701560e309..00000000000 --- a/srcpkgs/grub/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Mon, 26 Mar 2018 16:52:34 +0800 -Subject: Fix packed-not-aligned error on GCC 8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When building with GCC 8, there are several errors regarding packed-not-aligned. - -./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] - -This patch fixes the build error by cleaning up the ambiguity of placing -aligned structure in a packed one. In "struct grub_btrfs_time" and "struct -grub_gpt_part_type", the aligned attribute seems to be superfluous, and also -has to be packed, to ensure the structure is bit-to-bit mapped to the format -laid on disk. I think we could blame to copy and paste error here for the -mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as -the name suggests. :) - -Signed-off-by: Michael Chang -Tested-by: Michael Chang -Tested-by: Paul Menzel -Reviewed-by: Daniel Kiper ---- - grub-core/fs/btrfs.c | 2 +- - include/grub/efiemu/runtime.h | 2 +- - include/grub/gpt_partition.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4849c1ceb..be195448d 100644 ---- grub-core/fs/btrfs.c -+++ grub-core/fs/btrfs.c -@@ -175,7 +175,7 @@ struct grub_btrfs_time - { - grub_int64_t sec; - grub_uint32_t nanosec; --} __attribute__ ((aligned (4))); -+} GRUB_PACKED; - - struct grub_btrfs_inode - { -diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h -index 9b6b729f4..36d2dedf4 100644 ---- include/grub/efiemu/runtime.h -+++ include/grub/efiemu/runtime.h -@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel - - struct efi_variable - { -- grub_efi_guid_t guid; -+ grub_efi_packed_guid_t guid; - grub_uint32_t namelen; - grub_uint32_t size; - grub_efi_uint32_t attributes; -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f6725..9668a68c3 100644 ---- include/grub/gpt_partition.h -+++ include/grub/gpt_partition.h -@@ -28,7 +28,7 @@ struct grub_gpt_part_type - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; --} __attribute__ ((aligned(8))); -+} GRUB_PACKED; - typedef struct grub_gpt_part_type grub_gpt_part_type_t; - - #define GRUB_GPT_PARTITION_TYPE_EMPTY \ --- -cgit v1.1-33-g03f6 - diff --git a/srcpkgs/grub/patches/CVE-2015-8370.patch b/srcpkgs/grub/patches/CVE-2015-8370.patch deleted file mode 100644 index 7e0c1ba81b4..00000000000 --- a/srcpkgs/grub/patches/CVE-2015-8370.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e16eeda1200deabd0d3a4af968d526d62845a85f Mon Sep 17 00:00:00 2001 -From: Hector Marco-Gisbert -Date: Fri, 13 Nov 2015 16:21:09 +0100 -Subject: [PATCH] Fix security issue when reading username and password - - This patch fixes two integer underflows at: - * grub-core/lib/crypto.c - * grub-core/normal/auth.c - -Resolves: CVE-2015-8370 - -Signed-off-by: Hector Marco-Gisbert -Signed-off-by: Ismael Ripoll-Ripoll ---- - grub-core/lib/crypto.c | 2 +- - grub-core/normal/auth.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c -index 010e550..524a3d8 100644 ---- grub-core/lib/crypto.c -+++ grub-core/lib/crypto.c -@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned buf_size) - break; - } - -- if (key == '\b') -+ if (key == '\b' && cur_len) - { - cur_len--; - continue; -diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c -index c6bd96e..5782ec5 100644 ---- grub-core/normal/auth.c -+++ grub-core/normal/auth.c -@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size) - break; - } - -- if (key == '\b') -+ if (key == '\b' && cur_len) - { - cur_len--; - grub_printf ("\b"); --- -2.6.4 - diff --git a/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch b/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch deleted file mode 100644 index d4b91f9051d..00000000000 --- a/srcpkgs/grub/patches/grub-mkimage-R_X86_64_PLT32.patch +++ /dev/null @@ -1,33 +0,0 @@ -x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 - -Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a -x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for -32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as -R_X86_64_PC32. - -Signed-off-by: H.J. Lu -Reviewed-by: Daniel Kiper - ---- util/grub-mkimagexx.c -+++ util/grub-mkimagexx.c -@@ -841,6 +841,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index 9179285..a79271f 100644 ---- util/grub-module-verifier.c -+++ util/grub-module-verifier.c -@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { - -1 - }, (int[]){ - R_X86_64_PC32, -+ R_X86_64_PLT32, - -1 - } - }, diff --git a/srcpkgs/grub/patches/mkconfig_zfs.patch b/srcpkgs/grub/patches/mkconfig_zfs.patch deleted file mode 100644 index 686f28e6b91..00000000000 --- a/srcpkgs/grub/patches/mkconfig_zfs.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ./util/grub.d/10_linux.in 2015-01-19 13:30:29.490090317 +0200 -+++ ./util/grub.d/10_linux.in 2015-01-19 13:29:41.234754594 +0200 -@@ -67,6 +67,9 @@ - xzfs) - rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` - bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" -+ if [ -z "${rpool}" ]; then -+ rpool=$(zfs list -Ho name -t filesystem | grep -m1 "${bootfs}$" | sed 's/\/.*//') -+ fi - LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" - ;; - esac diff --git a/srcpkgs/grub/patches/ofnet-init-structs-in-bootpath-parser.patch b/srcpkgs/grub/patches/ofnet-init-structs-in-bootpath-parser.patch deleted file mode 100644 index 0f666a99945..00000000000 --- a/srcpkgs/grub/patches/ofnet-init-structs-in-bootpath-parser.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 7c52efa9093592ade59a986c5606450741fb8e59 Mon Sep 17 00:00:00 2001 -From: Julian Andres Klode -Date: Thu, 23 Aug 2018 13:25:30 +0200 -Subject: ofnet: Initialize structs in bootpath parser - -Code later on checks if variables inside the struct are -0 to see if they have been set, like if there were addresses -in the bootpath. - -The variables were not initialized however, so the check -might suceed with uninitialized data, and a new interface -with random addresses has been added. This caused a weird -bug in Ubuntu, because when booting from network, we now -had two interfaces with the same name, and net_default_mac -pointed to the random one. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785859 -Signed-off-by: Julian Andres Klode -Patch-Name: ofnet-init-structs-in-bootpath-parser.patch -Forwarded: https://lists.gnu.org/archive/html/grub-devel/2018-08/msg00074.html -Last-Update: 2018-08-23 ---- - grub-core/net/drivers/ieee1275/ofnet.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index a78d164db..3a753658b 100644 ---- grub-core/net/drivers/ieee1275/ofnet.c -+++ grub-core/net/drivers/ieee1275/ofnet.c -@@ -154,8 +154,8 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, - char *equal_char = 0; - grub_size_t field_counter = 0; - -- grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask; -- grub_net_link_level_address_t hw_addr; -+ grub_net_network_level_address_t client_addr = {}, gateway_addr = {}, subnet_mask = {}; -+ grub_net_link_level_address_t hw_addr = {}; - grub_net_interface_flags_t flags = 0; - struct grub_net_network_level_interface *inter = NULL; - diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template index c14322f4ed4..f99fdb84cda 100644 --- a/srcpkgs/grub/template +++ b/srcpkgs/grub/template @@ -1,8 +1,8 @@ # Template file for 'grub' pkgname=grub -version=2.02 -revision=6 -hostmakedepends="flex freetype-devel font-unifont-bdf" +version=2.04 +revision=1 +hostmakedepends="python3 pkg-config flex freetype-devel font-unifont-bdf" makedepends="libusb-compat-devel ncurses-devel freetype-devel liblzma-devel device-mapper-devel fuse-devel" depends="os-prober" @@ -12,7 +12,7 @@ maintainer="Juan RP " license="GPL-3" homepage="https://www.gnu.org/software/grub/" distfiles="${GNU_SITE}/grub/grub-${version}.tar.xz" -checksum=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f +checksum=e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d archs="i686* x86_64* aarch64* ppc ppc-musl ppc64*" nopie=yes