Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-02-03 Thread Yu, Yu-cheng
On 2/3/2021 2:11 PM, Dave Hansen wrote: On 2/3/21 1:54 PM, Yu, Yu-cheng wrote: On 1/29/2021 10:56 AM, Yu, Yu-cheng wrote: On 1/29/2021 9:07 AM, Dave Hansen wrote: On 1/27/21 1:25 PM, Yu-cheng Yu wrote: +    if (!IS_ENABLED(CONFIG_X86_CET)) +    return -EOPNOTSUPP; Let's ignore glibc for

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-02-03 Thread Dave Hansen
On 2/3/21 1:54 PM, Yu, Yu-cheng wrote: > On 1/29/2021 10:56 AM, Yu, Yu-cheng wrote: >> On 1/29/2021 9:07 AM, Dave Hansen wrote: >>> On 1/27/21 1:25 PM, Yu-cheng Yu wrote: +    if (!IS_ENABLED(CONFIG_X86_CET)) +    return -EOPNOTSUPP; >>> >>> Let's ignore glibc for a moment.  What erro

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-02-03 Thread Yu, Yu-cheng
On 1/29/2021 10:56 AM, Yu, Yu-cheng wrote: On 1/29/2021 9:07 AM, Dave Hansen wrote: On 1/27/21 1:25 PM, 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 i

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-01-29 Thread Yu, Yu-cheng
On 1/29/2021 11:15 AM, Dave Hansen wrote: On 1/29/21 10:56 AM, Yu, Yu-cheng wrote: On 1/29/2021 9:07 AM, Dave Hansen wrote: On 1/27/21 1:25 PM, Yu-cheng Yu wrote: [...] What's the point of doing copy_status_to_user() if the processor doesn't support CET?  In other words, shouldn't this be bel

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-01-29 Thread Dave Hansen
On 1/29/21 10:56 AM, Yu, Yu-cheng wrote: > On 1/29/2021 9:07 AM, Dave Hansen wrote: >> On 1/27/21 1:25 PM, Yu-cheng Yu wrote: >>> +    u64 buf[3] = {0, 0, 0}; Doesn't the compiler zero these if you initialize it to anything? In other words, doesn't this work? u64 buf[3] = {}; >>> +    i

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-01-29 Thread Yu, Yu-cheng
On 1/29/2021 9:07 AM, Dave Hansen wrote: On 1/27/21 1:25 PM, 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 sta

Re: [PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-01-29 Thread Dave Hansen
On 1/27/21 1:25 PM, 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 > *(args + 1) = shadow sta

[PATCH v18 24/25] x86/cet/shstk: Add arch_prctl functions for shadow stack

2021-01-27 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