Skip to content
Snippets Groups Projects
Commit e6a013f3 authored by Waiman Long's avatar Waiman Long
Browse files

x86/entry: Switch the stack after error_entry() returns

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2090231



commit 520a7e80
Author: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Date:   Thu, 21 Apr 2022 22:10:49 +0800

    x86/entry: Switch the stack after error_entry() returns

    error_entry() calls fixup_bad_iret() before sync_regs() if it is a fault
    from a bad IRET, to copy pt_regs to the kernel stack. It switches to the
    kernel stack directly after sync_regs().

    But error_entry() itself is also a function call, so it has to stash
    the address it is going to return to, in %r12 which is unnecessarily
    complicated.

    Move the stack switching after error_entry() and get rid of the need to
    handle the return address.

      [ bp: Massage commit message. ]

Signed-off-by: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Link: https://lore.kernel.org/r/20220503032107.680190-3-jiangshanlai@gmail.com



Signed-off-by: default avatarWaiman Long <longman@redhat.com>
parent a98af5a5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment