lkml.org 
[lkml]   [2021]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v27 23/31] x86/cet/shstk: Add user-mode shadow stack support
From
Date
On 7/19/2021 11:23 AM, Edgecombe, Rick P wrote:
> On Fri, 2021-05-21 at 15:12 -0700, Yu-cheng Yu wrote:
>> Introduce basic shadow stack enabling/disabling/allocation routines.
>> A task's shadow stack is allocated from memory with VM_SHADOW_STACK
>> flag
>> and has a fixed size of min(RLIMIT_STACK, 4GB).
>>
>> Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
>> Cc: Kees Cook <keescook@chromium.org>

[...]

>> diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c
>> new file mode 100644
>> index 000000000000..5ea2b494e9f9
>> --- /dev/null
>> +++ b/arch/x86/kernel/shstk.c

[...]

>> +int shstk_setup(void)
>> +{
>> +       struct thread_shstk *shstk = &current->thread.shstk;
>> +       unsigned long addr, size;
>> +
>> +       if (!cpu_feature_enabled(X86_FEATURE_SHSTK))
>> +               return -EOPNOTSUPP;
> The only caller of this will skip it if
> !cpu_feature_enabled(X86_FEATURE_SHSTK), so this is dead logic. Same
> pattern in the IBT patch.
>

Indeed that is the case. We can simply remove the test of
X86_FEATURE_SHSTK.

Thanks,
Yu-cheng

\
 
 \ /
  Last update: 2021-07-20 19:17    [W:0.171 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site