From: Greg Kroah-Hartman Date: Fri, 23 Feb 2024 16:10:18 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v4.19.308~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9e128e884bda9776ac524845699e362f53db272;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch --- 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 index 00000000000..0598199538a --- /dev/null +++ b/queue-6.1/riscv-efistub-ensure-gp-relative-addressing-is-not-used.patch @@ -0,0 +1,34 @@ +From afb2a4fb84555ef9e61061f6ea63ed7087b295d5 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Fri, 12 Jan 2024 19:37:29 +0100 +Subject: riscv/efistub: Ensure GP-relative addressing is not used + +From: Jan Kiszka + +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: +Signed-off-by: Jan Kiszka +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman +--- + 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 + diff --git a/queue-6.1/series b/queue-6.1/series index 2a518685bd9..5f132c379e9 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -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