From 9fb6a787bdde7354686c90c93f62e60c9e482695 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 25 Jun 2020 18:18:52 -0700 Subject: Added hotfix --- ...efi-libstub-Fix-path-separator-regression.patch | 54 ++++++++++++++++++++++ PKGBUILD | 5 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0002-efi-libstub-Fix-path-separator-regression.patch diff --git a/0002-efi-libstub-Fix-path-separator-regression.patch b/0002-efi-libstub-Fix-path-separator-regression.patch new file mode 100644 index 0000000..ad780ee --- /dev/null +++ b/0002-efi-libstub-Fix-path-separator-regression.patch @@ -0,0 +1,54 @@ +From 2eff8033714ddf05bb2fe52003921af8c8839ed2 Mon Sep 17 00:00:00 2001 +From: Philipp Fent +Date: Mon, 15 Jun 2020 13:51:09 +0200 +Subject: efi/libstub: Fix path separator regression + +Commit 9302c1bb8e47 ("efi/libstub: Rewrite file I/O routine") introduced a +regression that made a couple of (badly configured) systems fail to +boot [1]: Until 5.6, we silently accepted Unix-style file separators in +EFI paths, which might violate the EFI standard, but are an easy to make +mistake. This fix restores the pre-5.7 behaviour. + +[1] https://bbs.archlinux.org/viewtopic.php?id=256273 + +Fixes: 9302c1bb8e47 ("efi/libstub: Rewrite file I/O routine") +Signed-off-by: Philipp Fent +Link: https://lore.kernel.org/r/20200615115109.7823-1-fent@in.tum.de +[ardb: rewrite as chained if/else statements] +Signed-off-by: Ard Biesheuvel +--- + drivers/firmware/efi/libstub/file.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c +index ea66b1f16a79..f1c4faf58c76 100644 +--- a/drivers/firmware/efi/libstub/file.c ++++ b/drivers/firmware/efi/libstub/file.c +@@ -104,12 +104,20 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len, + if (!found) + return 0; + ++ /* Skip any leading slashes */ ++ while (cmdline[i] == L'/' || cmdline[i] == L'\\') ++ i++; ++ + while (--result_len > 0 && i < cmdline_len) { +- if (cmdline[i] == L'\0' || +- cmdline[i] == L'\n' || +- cmdline[i] == L' ') ++ efi_char16_t c = cmdline[i++]; ++ ++ if (c == L'\0' || c == L'\n' || c == L' ') + break; +- *result++ = cmdline[i++]; ++ else if (c == L'/') ++ /* Replace UNIX dir separators with EFI standard ones */ ++ *result++ = L'\\'; ++ else ++ *result++ = c; + } + *result = L'\0'; + return i; +-- +cgit v1.2.3-1-gf6bb5 + diff --git a/PKGBUILD b/PKGBUILD index 52d429b..0a2db13 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -22,7 +22,7 @@ _gccpatchker='5.7' else pkgver=${_supver}.${_majver}.${_minver} fi -pkgrel=1 +pkgrel=1.2 pkgdesc='Linux-libre' url='https://linux-libre.fsfla.org/' arch=(x86_64) @@ -39,6 +39,7 @@ _gnupkgver=${pkgver}-gnu source=( https://linux-libre.fsfla.org/pub/linux-libre/releases/${_gnumajver}/linux-libre-${_gnumajver}.tar.xz{,.sign} 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-efi-libstub-Fix-path-separator-regression.patch kernel_gcc_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gccpatchver}.tar.gz ath9k-regdom-hack.patch raid6-default-algo.patch @@ -54,6 +55,7 @@ validpgpkeys=( b2sums=('bb65e65c69d1c38943327a0859028c843439590e9f1af66705a0fe01aaf006daf14a5a0adfaef6d1de53511e50b2f6b8ee13caa63dd7cf4065253599fe524998' 'SKIP' 'ab1fb19c67d4c107f75767581c33d9c1458b4d9fdb88f4adb41d30a36f5a2f95f1c48ef079eb87e1e6e8ce2f98b293195cb2c0f2a8ec975aa817453289158c6e' + '3bb69cc581164cfdc416198b8a1d3d905d98e7f0f6f739d68a0c19d697e76545230f9e224d08e09c15d0ea3126a73608b56dbfa852892462bc11ef9dac525811' 'c8d0697f99fe6105815217b8ec059d8f587415ea8dd2b88a65e1087feedf697341a64cd56810fde9e7aeada79125fc8235faccc7e7b06492c099e27a8abbe99c' '2e58bb89b247b1678355368956e67c1de51fcde97a227b2162f6771e30f17fa5520faafe7be4b6816a542e7ae10d05f64c6b6354f352c12746d4b8da632936dd' 'fde132f3705d908e6f2147c78a2193289916d72304ca5efa2229d79fc3e57a857314ce94e71425caef2f7f7b6cf87f05ef86335dc8bd4be78e7035afe608005a' @@ -79,6 +81,7 @@ prepare() { # Hotfixes echo "Applying hotfixes" patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + patch -p1 -i ../0002-efi-libstub-Fix-path-separator-regression.patch patch -p1 -i ../sphinx-workaround.patch -- cgit v1.2.1