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

Edgecombe, Rick P
2023-03-13T02:53:36Z

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@intel.com>
> > Tested-by: John Allen <john.allen@amd.com>
> > Tested-by: Kees Cook <keescook@chromium.org>
> > Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> > Co-developed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> > Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
>
> 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@intel.com>
> Co-developed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
>
> 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.