Patch "x86: Annotate call_on_stack()" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86: Annotate call_on_stack()

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-annotate-call_on_stack.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a6cefda7f24c840569a619b5c1669c323b1f1996
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Date:   Tue Mar 8 16:30:50 2022 +0100

    x86: Annotate call_on_stack()
    
    [ Upstream commit be0075951fde739f14ee2b659e2fd6e2499c46c0 ]
    
    vmlinux.o: warning: objtool: page_fault_oops()+0x13c: unreachable instruction
    
    0000 000000000005b460 <page_fault_oops>:
    ...
    0128    5b588:  49 89 23                mov    %rsp,(%r11)
    012b    5b58b:  4c 89 dc                mov    %r11,%rsp
    012e    5b58e:  4c 89 f2                mov    %r14,%rdx
    0131    5b591:  48 89 ee                mov    %rbp,%rsi
    0134    5b594:  4c 89 e7                mov    %r12,%rdi
    0137    5b597:  e8 00 00 00 00          call   5b59c <page_fault_oops+0x13c>    5b598: R_X86_64_PLT32   handle_stack_overflow-0x4
    013c    5b59c:  5c                      pop    %rsp
    
    vmlinux.o: warning: objtool: sysvec_reboot()+0x6d: unreachable instruction
    
    0000 00000000000033f0 <sysvec_reboot>:
    ...
    005d     344d:  4c 89 dc                mov    %r11,%rsp
    0060     3450:  e8 00 00 00 00          call   3455 <sysvec_reboot+0x65>        3451: R_X86_64_PLT32    irq_enter_rcu-0x4
    0065     3455:  48 89 ef                mov    %rbp,%rdi
    0068     3458:  e8 00 00 00 00          call   345d <sysvec_reboot+0x6d>        3459: R_X86_64_PC32     .text+0x47d0c
    006d     345d:  e8 00 00 00 00          call   3462 <sysvec_reboot+0x72>        345e: R_X86_64_PLT32    irq_exit_rcu-0x4
    0072     3462:  5c                      pop    %rsp
    
    Both cases are due to a call_on_stack() calling a __noreturn function.
    Since that's an inline asm, GCC can't do anything about the
    instructions after the CALL. Therefore put in an explicit
    ASM_REACHABLE annotation to make sure objtool and gcc are consistently
    confused about control flow.
    
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220308154319.468805622@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/include/asm/irq_stack.h b/arch/x86/include/asm/irq_stack.h
index ae9d40f6c706..05af249d6bec 100644
--- a/arch/x86/include/asm/irq_stack.h
+++ b/arch/x86/include/asm/irq_stack.h
@@ -99,7 +99,8 @@
 }
 
 #define ASM_CALL_ARG0							\
-	"call %P[__func]				\n"
+	"call %P[__func]				\n"		\
+	ASM_REACHABLE
 
 #define ASM_CALL_ARG1							\
 	"movq	%[arg1], %%rdi				\n"		\



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux