lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v27 24/31] x86/cet/shstk: Handle thread shadow stack
From
Date
On 5/22/2021 4:39 PM, Andy Lutomirski wrote:
> On Fri, May 21, 2021 at 3:14 PM Yu-cheng Yu <yu-cheng.yu@intel.com> wrote:
>> diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c
>> index 5ea2b494e9f9..8e5f772181b9 100644
>> --- a/arch/x86/kernel/shstk.c
>> +++ b/arch/x86/kernel/shstk.c
>> @@ -71,6 +71,53 @@ int shstk_setup(void)
>> return 0;
>> }
>>
>> +int shstk_alloc_thread_stack(struct task_struct *tsk, unsigned long clone_flags,
>> + unsigned long stack_size)
>> +{
>
> ...
>
>> + state = get_xsave_addr(&tsk->thread.fpu.state.xsave, XFEATURE_CET_USER);
>> + if (!state)
>> + return -EINVAL;
>> +
>
> The get_xsave_addr() API is horrible, and we already have one
> egregiously buggy instance in the kernel. Let's not add another
> dubious use case.
>
> If state == NULL, this means that CET_USER is in its init state.
> CET_USER in the init state should behave identically regardless of
> whether XINUSE[CET_USER] is set. Can you please adjust this code
> accordingly?
>

I will work on that.

Thanks,
Yu-cheng

\
 
 \ /
  Last update: 2021-05-25 17:05    [W:0.134 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site