Patch "x86/sev: Annotate stack change in the #VC handler" has been added to the 5.15-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/sev: Annotate stack change in the #VC handler

to the 5.15-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-sev-annotate-stack-change-in-the-vc-handler.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 250a11a47c7b117fbb5cd4c6a921512df923d75e
Author: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx>
Date:   Wed Mar 16 12:16:12 2022 +0800

    x86/sev: Annotate stack change in the #VC handler
    
    [ Upstream commit c42b145181aafd59ed31ccd879493389e3ea5a08 ]
    
    In idtentry_vc(), vc_switch_off_ist() determines a safe stack to
    switch to, off of the IST stack. Annotate the new stack switch with
    ENCODE_FRAME_POINTER in case UNWINDER_FRAME_POINTER is used.
    
    A stack walk before looks like this:
    
      CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #2
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      Call Trace:
       <TASK>
       dump_stack_lvl
       dump_stack
       kernel_exc_vmm_communication
       asm_exc_vmm_communication
       ? native_read_msr
       ? __x2apic_disable.part.0
       ? x2apic_setup
       ? cpu_init
       ? trap_init
       ? start_kernel
       ? x86_64_start_reservations
       ? x86_64_start_kernel
       ? secondary_startup_64_no_verify
       </TASK>
    
    and with the fix, the stack dump is exact:
    
      CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #3
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      Call Trace:
       <TASK>
       dump_stack_lvl
       dump_stack
       kernel_exc_vmm_communication
       asm_exc_vmm_communication
      RIP: 0010:native_read_msr
      Code: ...
      < snipped regs >
       ? __x2apic_disable.part.0
       x2apic_setup
       cpu_init
       trap_init
       start_kernel
       x86_64_start_reservations
       x86_64_start_kernel
       secondary_startup_64_no_verify
       </TASK>
    
      [ bp: Test in a SEV-ES guest and rewrite the commit message to
        explain what exactly this does. ]
    
    Fixes: a13644f3a53d ("x86/entry/64: Add entry code for #VC handler")
    Signed-off-by: Lai Jiangshan <jiangshan.ljs@xxxxxxxxxxxx>
    Signed-off-by: Borislav Petkov <bp@xxxxxxx>
    Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220316041612.71357-1-jiangshanlai@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index e23319ad3f42..3acf0af49305 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -499,6 +499,7 @@ SYM_CODE_START(\asmsym)
 	call	vc_switch_off_ist
 	movq	%rax, %rsp		/* Switch to new stack */
 
+	ENCODE_FRAME_POINTER
 	UNWIND_HINT_REGS
 
 	/* Update pt_regs */



[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