Re: [PATCH v10 26/26] x86/cet/shstk: Add arch_prctl functions for shadow stack

2020-05-22 Thread Yu-cheng Yu
On Fri, 2020-05-22 at 19:29 +0200, Eugene Syromiatnikov wrote: > On Fri, May 22, 2020 at 10:17:43AM -0700, Yu-cheng Yu wrote: > > On Thu, 2020-05-21 at 15:42 -0700, Kees Cook wrote: > > > On Wed, Apr 29, 2020 at 03:07:32PM -0700, Yu-cheng Yu wrote: > > [...] > > > > + > > > > +int prctl_cet(int opt

Re: [PATCH v10 26/26] x86/cet/shstk: Add arch_prctl functions for shadow stack

2020-05-22 Thread Eugene Syromiatnikov
On Fri, May 22, 2020 at 10:17:43AM -0700, Yu-cheng Yu wrote: > On Thu, 2020-05-21 at 15:42 -0700, Kees Cook wrote: > > On Wed, Apr 29, 2020 at 03:07:32PM -0700, Yu-cheng Yu wrote: > [...] > > > + > > > +int prctl_cet(int option, u64 arg2) > > > +{ > > > + struct cet_status *cet; > > > + > > > + if

Re: [PATCH v10 26/26] x86/cet/shstk: Add arch_prctl functions for shadow stack

2020-05-22 Thread Yu-cheng Yu
On Thu, 2020-05-21 at 15:42 -0700, Kees Cook wrote: > On Wed, Apr 29, 2020 at 03:07:32PM -0700, Yu-cheng Yu wrote: [...] > > + > > +int prctl_cet(int option, u64 arg2) > > +{ > > + struct cet_status *cet; > > + > > + if (!IS_ENABLED(CONFIG_X86_INTEL_CET)) > > + return -EINVAL; > > Us

Re: [PATCH v10 26/26] x86/cet/shstk: Add arch_prctl functions for shadow stack

2020-05-21 Thread Kees Cook
On Wed, Apr 29, 2020 at 03:07:32PM -0700, Yu-cheng Yu wrote: > arch_prctl(ARCH_X86_CET_STATUS, u64 *args) > Get CET feature status. > > The parameter 'args' is a pointer to a user buffer. The kernel returns > the following information: > > *args = shadow stack/IBT status > *(

[PATCH v10 26/26] x86/cet/shstk: Add arch_prctl functions for shadow stack

2020-04-29 Thread Yu-cheng Yu
arch_prctl(ARCH_X86_CET_STATUS, u64 *args) Get CET feature status. The parameter 'args' is a pointer to a user buffer. The kernel returns the following information: *args = shadow stack/IBT status *(args + 1) = shadow stack base address *(args + 2) = shadow stack size ar