]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 16:10:18 +0000 (17:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 16:10:18 +0000 (17:10 +0100)
added patches:
riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch

queue-6.1/riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch b/queue-6.1/riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch
new file mode 100644 (file)
index 0000000..0598199
--- /dev/null
@@ -0,0 +1,34 @@
+From afb2a4fb84555ef9e61061f6ea63ed7087b295d5 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Fri, 12 Jan 2024 19:37:29 +0100
+Subject: riscv/efistub: Ensure GP-relative addressing is not used
+
+From: Jan Kiszka <jan.kiszka@siemens.com>
+
+commit afb2a4fb84555ef9e61061f6ea63ed7087b295d5 upstream.
+
+The cflags for the RISC-V efistub were missing -mno-relax, thus were
+under the risk that the compiler could use GP-relative addressing. That
+happened for _edata with binutils-2.41 and kernel 6.1, causing the
+relocation to fail due to an invalid kernel_size in handle_kernel_image.
+It was not yet observed with newer versions, but that may just be luck.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/efi/libstub/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/firmware/efi/libstub/Makefile
++++ b/drivers/firmware/efi/libstub/Makefile
+@@ -25,7 +25,7 @@ cflags-$(CONFIG_ARM)         := $(subst $(CC_FL
+                                  -fno-builtin -fpic \
+                                  $(call cc-option,-mno-single-pic-base)
+ cflags-$(CONFIG_RISCV)                := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
+-                                 -fpic
++                                 -fpic -mno-relax
+ cflags-$(CONFIG_LOONGARCH)    := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
+                                  -fpie
index 2a518685bd9c29eaa103dd040c71e678e5134426..5f132c379e9770e0550201633850c8a8df2c814b 100644 (file)
@@ -4,3 +4,4 @@ net-sched-retire-dsmark-qdisc.patch
 sched-rt-disallow-writing-invalid-values-to-sched_rt_period_us.patch
 sched-rt-sysctl_sched_rr_timeslice-show-default-timeslice-after-reset.patch
 pci-dwc-fix-a-64bit-bug-in-dw_pcie_ep_raise_msix_irq.patch
+riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch