Re: [PATCH v7 39/41] x86: Add PTRACE interface for shadow stack

From: Edgecombe, Rick P
Date: Sun Mar 12 2023 - 22:53:40 EST


On Sat, 2023-03-11 at 16:06 +0100, Borislav Petkov wrote:
> On Mon, Feb 27, 2023 at 02:29:55PM -0800, Rick Edgecombe wrote:
[...]
Tested-by: Pengfei Xu <pengfei.xu@xxxxxxxxx>
> > Tested-by: John Allen <john.allen@xxxxxxx>
> > Tested-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > Acked-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
> > Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > Co-developed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> > Signed-off-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@xxxxxxxxx>
>
> I think your SOB should come last:

Right on commit log typos, and yea this is screwed up. I think Dave re-
ordered the SOB's already.

>
> ...
> Signed-off-by: Yu-cheng Yu <yu-cheng.yu@xxxxxxxxx>
> Co-developed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
>
> Pls check whole set.
>
>
> > +#ifdef CONFIG_X86_USER_SHADOW_STACK
> > +int ssp_active(struct task_struct *target, const struct
> > user_regset *regset)
> > +{
> > + if (target->thread.features & ARCH_SHSTK_SHSTK)
> > + return regset->n;
> > +
> > + return 0;
> > +}
> > +
> > +int ssp_get(struct task_struct *target, const struct user_regset
> > *regset,
> > + struct membuf to)
> > +{
> > + struct fpu *fpu = &target->thread.fpu;
> > + struct cet_user_state *cetregs;
> > +
> > + if (!boot_cpu_has(X86_FEATURE_USER_SHSTK))
>
> check_for_deprecated_apis: WARNING: arch/x86/kernel/fpu/regset.c:193:
> Do not use boot_cpu_has() - use cpu_feature_enabled() instead.
>
> Check your whole set pls.

Ok. I think the other case is in "x86/fpu: Add helper for initing
features" where it was moved code.