]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
riscv/efistub: Ensure GP-relative addressing is not used
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 12 Jan 2024 18:37:29 +0000 (19:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:47 +0000 (13:34 +0100)
commit5babeec518c24d42d834228c3f115e66897667ae
treeeec5218e609adc60a460e4b15857ca4485111b83
parent6ea2f3b9b9f6061b21efad834b2bbbe4429bc6df
riscv/efistub: Ensure GP-relative addressing is not used

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