Re: [RFC PATCH 04/27] x86/cet: Make kernel shadow stack #CP fatal instead of livelocking

From: Andrew Cooper

Date: Mon Nov 30 2026 - 11:55:09 EST


On 29/11/2026 10:29 pm, K Prateek Nayak wrote:
> diff --git a/arch/x86/kernel/cet.c b/arch/x86/kernel/cet.c
> index 4033775a922c..97375a8335c8 100644
> --- a/arch/x86/kernel/cet.c
> +++ b/arch/x86/kernel/cet.c
> @@ -112,6 +114,77 @@ static void ibt_clear_fred_wfe(struct pt_regs *regs)
> regs->fred_cs.wfe = 0;
> }
>
> +/*
> + * FRED hardware pushes this frame on to the shadow stack for
> + * kernel=>kernel entry. First (lowest address) in this struct
> + * is the last entry pushed by the hardware.
> + */
> +struct fred_shstk_entry_frame {
> + u64 ssef_ssp;
> + u64 ssef_lip;
> + u64 ssef_cs;
> +};

The fred_ prefix should be removed.  This is plain CET-SS, and the
format is the same in IDT mode too.

~Andrew