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

2024-10-15 Thread Nathan Chancellor
On Fri, Oct 11, 2024 at 03:58:04PM +0300, Mike Rapoport wrote: > I overlooked how cfi_*_callers routines update addr. > This patch should fix it: Thanks, can confirm. My boot is working again and LKDTM's CFI_FORWARD_PROTO test properly fails. > diff --git a/arch/x86/kernel/alternative.c b/arch/x8

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

2024-10-11 Thread Mike Rapoport
On Thu, Oct 10, 2024 at 03:54:11PM -0700, Nathan Chancellor wrote: > Hi Mike, > > On Wed, Oct 09, 2024 at 09:08:14PM +0300, Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > When module text memory will be allocated with ROX permissions, the > > memory at the actual address wher

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

2024-10-10 Thread Nathan Chancellor
Hi Mike, On Wed, Oct 09, 2024 at 09:08:14PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > When module text memory will be allocated with ROX permissions, the > memory at the actual address where the module will live will contain > invalid instructions and there will be a wr

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

2024-10-10 Thread Christoph Hellwig
> +extern void apply_alternatives(struct alt_instr *start, struct alt_instr > *end, > +struct module *mod); > +extern void apply_retpolines(s32 *start, s32 *end, struct module *mod); > +extern void apply_returns(s32 *start, s32 *end, struct module *mod); > +extern void

[PATCH v5 6/8] x86/module: perpare module loading for ROX allocations of text

2024-10-09 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" When module text memory will be allocated with ROX permissions, the memory at the actual address where the module will live will contain invalid instructions and there will be a writable copy that contains the actual module code. Update relocations and alternati