diff options
author | eworm | 2017-01-09 11:35:57 +0000 |
---|---|---|
committer | svntogit | 2017-01-09 11:35:57 +0000 |
commit | 863e992481b2eb8fcef5c2815cbe398c60e8f6c2 (patch) | |
tree | 2e72ee2f0d287689220ddae2210628ae3d6a0069 | |
parent | a9407fe2a621cc11d22b692407f0ede76b466081 (diff) | |
download | aur-863e992481b2eb8fcef5c2815cbe398c60e8f6c2.tar.gz |
upgpkg: grub 1:2.02.beta3-5
efi: properly terminate filepath with NULL in chainloader (FS#52412)
git-svn-id: file:///srv/repos/svn-packages/svn@285562 eb2447ed-0c53-47e4-bac8-5bc4a241df78
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | 0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch | 44 | ||||
-rw-r--r-- | PKGBUILD | 8 |
3 files changed, 54 insertions, 2 deletions
@@ -1,7 +1,7 @@ pkgbase = grub pkgdesc = GNU GRand Unified Bootloader (2) pkgver = 2.02.beta3 - pkgrel = 4 + pkgrel = 5 epoch = 1 url = https://www.gnu.org/software/grub/ install = grub.install @@ -57,6 +57,7 @@ pkgbase = grub source = 0003-10_linux-detect-archlinux-initramfs.patch source = 0004-add-GRUB_COLOR_variables.patch source = 0005-10_linux-fix-grouping-of-tests.patch + source = 0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch source = grub.default source = grub.cfg validpgpkeys = 95D2E9AB8740D8046387FD151A09227B1F435A33 @@ -69,6 +70,7 @@ pkgbase = grub sha256sums = b41e4438319136b5e74e0abdfcb64ae115393e4e15207490272c425f54026dd3 sha256sums = a5198267ceb04dceb6d2ea7800281a42b3f91fd02da55d2cc9ea20d47273ca29 sha256sums = bf712de689a944ac23a0303bbcc223eedf8d4fcb5c94bdc071c71c2444158a7f + sha256sums = d99f47642d325398873346e25ecb646c387e358e25b05128fa333cc7721a7388 sha256sums = df764fbd876947dea973017f95371e53833bf878458140b09f0b70d900235676 sha256sums = c5e4f3836130c6885e9273c21f057263eba53f4b7c0e2f111f6e5f2e487a47ad diff --git a/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch b/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch new file mode 100644 index 000000000000..b7961072436c --- /dev/null +++ b/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch @@ -0,0 +1,44 @@ +From ce95549cc54b5d6f494608a7c390dba3aab4fba7 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov <arvidjaar@gmail.com> +Date: Thu, 15 Dec 2016 16:07:00 +0300 +Subject: efi: properly terminate filepath with NULL in chainloader + +EFI File Path Media Device Path is defined as NULL terminated string; +but chainloader built file paths without final NULL. This caused error +with Secure Boot and Linux Foundation PreLoader on Acer with InsydeH20 BIOS. +Apparently firmware failed verification with EFI_INVALID_PARAMETER which is +considered fatal error by PreLoader. + +Reported and tested by Giovanni Santini <itachi.sama.amaterasu@gmail.com> +--- + grub-core/loader/efi/chainloader.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c +index 522a716..adc8563 100644 +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -122,6 +122,8 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, + if (*p == '/') + *p = '\\'; + ++ /* File Path is NULL terminated */ ++ fp->path_name[size++] = '\0'; + fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp); + } + +@@ -156,8 +158,10 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) + d = GRUB_EFI_NEXT_DEVICE_PATH (d); + } + ++ /* File Path is NULL terminated. Allocate space for 2 extra characters */ ++ /* FIXME why we split path in two components? */ + file_path = grub_malloc (size +- + ((grub_strlen (dir_start) + 1) ++ + ((grub_strlen (dir_start) + 2) + * GRUB_MAX_UTF16_PER_UTF8 + * sizeof (grub_efi_char16_t)) + + sizeof (grub_efi_file_path_device_path_t) * 2); +-- +cgit v1.0 + @@ -23,7 +23,7 @@ _UNIFONT_VER="6.3.20131217" pkgname="grub" pkgdesc="GNU GRand Unified Bootloader (2)" pkgver=2.02.beta3 -pkgrel=4 +pkgrel=5 epoch=1 url="https://www.gnu.org/software/grub/" arch=('x86_64' 'i686') @@ -64,6 +64,7 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG} '0003-10_linux-detect-archlinux-initramfs.patch' '0004-add-GRUB_COLOR_variables.patch' '0005-10_linux-fix-grouping-of-tests.patch' + '0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch' 'grub.default' 'grub.cfg') @@ -76,6 +77,7 @@ sha256sums=('SKIP' 'b41e4438319136b5e74e0abdfcb64ae115393e4e15207490272c425f54026dd3' 'a5198267ceb04dceb6d2ea7800281a42b3f91fd02da55d2cc9ea20d47273ca29' 'bf712de689a944ac23a0303bbcc223eedf8d4fcb5c94bdc071c71c2444158a7f' + 'd99f47642d325398873346e25ecb646c387e358e25b05128fa333cc7721a7388' 'df764fbd876947dea973017f95371e53833bf878458140b09f0b70d900235676' 'c5e4f3836130c6885e9273c21f057263eba53f4b7c0e2f111f6e5f2e487a47ad') @@ -109,6 +111,10 @@ prepare() { patch -Np1 -i "${srcdir}/0005-10_linux-fix-grouping-of-tests.patch" echo + msg "Patch to properly terminate filepath with NULL in chainloader" + patch -Np1 -i "${srcdir}/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch" + echo + msg "Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme" sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub-${_pkgver}/configure.ac" |