Thread (16 messages) 16 messages, 4 authors, 2025-02-28

Re: [PATCH v7 6/8] x86/module: prepare module loading for ROX allocations of text

From: Nathan Chancellor <nathan@kernel.org>
Date: 2024-11-05 19:04:32
Also in: bpf, linux-alpha, linux-arch, linux-m68k, linux-mips, linux-mm, linux-modules, linux-riscv, linux-sh, linux-trace-kernel, linux-um, lkml, loongarch, sparclinux

On Tue, Nov 05, 2024 at 09:02:26AM +0200, Mike Rapoport wrote:
There's a silly mistake in cfi_rewrite_endbr() in that commit, the patch
below should fix it. Can you please test?
Yup, that was it! All my machines boot with this diff applied on top of
next-20241105, so with that fixed, I think we are all good here.

Tested-by: Nathan Chancellor <nathan@kernel.org>
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 3407efc26528..243843e44e89 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1241,7 +1241,7 @@ static void cfi_rewrite_endbr(s32 *start, s32 *end, struct module *mod)
 		void *addr = (void *)s + *s;
 		void *wr_addr = module_writable_address(mod, addr);
 
-		poison_endbr(addr+16, wr_addr, false);
+		poison_endbr(addr + 16, wr_addr + 16, false);
 	}
 }
Cheers,
Nathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help