Re: [RFC PATCH v2 25/27] x86/cet: Add PTRACE interface for CET

From: Yu-cheng Yu
Date: Thu Jul 12 2018 - 18:40:58 EST


On Thu, 2018-07-12 at 16:03 +0200, Ingo Molnar wrote:
> * Yu-cheng Yu <yu-cheng.yu@xxxxxxxxx> wrote:
>
> >
> > >
> > > >
> > > > diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
> > > > index e2ee403865eb..ac2bc3a18427 100644
> > > > --- a/arch/x86/kernel/ptrace.c
> > > > +++ b/arch/x86/kernel/ptrace.c
> > > > @@ -49,7 +49,9 @@ enum x86_regset {
> > > > Â REGSET_IOPERM64 = REGSET_XFP,
> > > > Â REGSET_XSTATE,
> > > > Â REGSET_TLS,
> > > > + REGSET_CET64 = REGSET_TLS,
> > > > Â REGSET_IOPERM32,
> > > > + REGSET_CET32,
> > > > Â};
> > > Why does REGSET_CET64 alias on REGSET_TLS?
> > In x86_64_regsets[], there is no [REGSET_TLS]. ÂThe core dump code
> > cannot handle holes in the array.
> Is there a fundamental (ABI) reason for that?

What I did was, ran Linux with 'slub_debug', and forced a core dump
(kill -abrt <pid>), then there was a red zone warning in the dmesg.
My feeling is there could be issues in the core dump code. ÂThese
enum's are only local to arch/x86/kernel/ptrace.c and not exported.
I am not aware this is in the ABI.

>
> >
> > >
> > > to "CET" (which is a well-known acronym for "Central European Time"),
> > > not to CFE?
> > >
> > I don't know if I can change that, will find out.
> So what I'd suggest is something pretty simple: to use CFT/cft in kernel internalÂ
> names, except for the Intel feature bit and any MSR enumeration which can be CETÂ
> if Intel named it that way, and a short comment explaining the acronym difference.
>
> Or something like that.

Ok, I will make changes in the next version and probably revise
from that if still not optimal.

Yu-cheng