* Andy Lutomirski <[email protected]> wrote:

> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index 1ea03027a4a9..e4a941be96cf 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c

> -asmlinkage __visible notrace
> +asmlinkage __visible notrace __no_sanitize_address
>  struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
>  {
>       /*
>        * This is called from entry_64.S early in handling a fault
>        * caused by a bad iret to user mode.  To handle the fault
> -      * correctly, we want move our stack frame to task_pt_regs
> -      * and we want to pretend that the exception came from the
> -      * iret target.
> +      * correctly, we want move our stack frame to where it would
> +      * be had we entered directly on the entry stack (rather than
> +      * just below the IRET frame) and we want to pretend that the
> +      * exception came from the iret target.
>        */
>       struct bad_iret_stack *new_stack =
> -             container_of(task_pt_regs(current),
> -                          struct bad_iret_stack, regs);
> +             (struct bad_iret_stack *)this_cpu_read(cpu_tss.x86_tss.sp0) - 1;
>  
>       /* Copy the IRET target to the new stack. */
>       memmove(&new_stack->regs.ip, (void *)s->regs.sp, 5*8);

So the addition of the __no_sanitize_address attribute to fixup_bad_iret() made 
the 64-bit allyesconfig/allmodconfig kernels fail the build:

 In file included from ./include/linux/bitmap.h:9:0,
 arch/x86/kernel/traps.c: In function ‘fixup_bad_iret’:
 ./include/linux/string.h:344:24: error: inlining failed in call to 
always_inline 
 ‘memmove’: function attribute mismatch
  __FORTIFY_INLINE void *memmove(void *p, const void *q, __kernel_size_t size)
 arch/x86/kernel/traps.c:645:2: error: called from here
 In file included from ./include/linux/bitmap.h:9:0,
 ./include/linux/string.h:344:24: error: inlining failed in call to 
always_inline 
 ‘memmove’: function attribute mismatch
  __FORTIFY_INLINE void *memmove(void *p, const void *q, __kernel_size_t size)
 arch/x86/kernel/traps.c:642:2: error: called from here
 scripts/Makefile.build:314: recipe for target 'arch/x86/kernel/traps.o' failed

Thanks,

        Ingo

Reply via email to