Re: [PATCH V4 1/7] x86/traps: Move pt_regs only in fixup_bad_iret()
From: Borislav Petkov
Date: Mon Apr 11 2022 - 05:37:34 EST
On Fri, Mar 18, 2022 at 10:30:10PM +0800, Lai Jiangshan wrote:
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index 1563fb995005..9fe9cd9d3eeb 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -892,13 +892,8 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r
> }
> #endif
>
> -struct bad_iret_stack {
> - void *error_entry_ret;
> - struct pt_regs regs;
> -};
> -
> asmlinkage __visible noinstr
> -struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
> +struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs)
> {
> /*
> * This is called from entry_64.S early in handling a fault
While at it, unbreak that line:
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 9fe9cd9d3eeb..28591132e885 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -892,8 +892,7 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r
}
#endif
-asmlinkage __visible noinstr
-struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs)
+asmlinkage __visible noinstr struct pt_regs *fixup_bad_iret(struct pt_regs *bad_regs)
{
/*
* This is called from entry_64.S early in handling a fault
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette