Thread (110 messages) 110 messages, 8 authors, 2023-02-17

Re: [PATCH v5 04/39] x86/cpufeatures: Enable CET CR4 bit for shadow stack

From: Kees Cook <hidden>
Date: 2023-01-20 00:46:47
Also in: linux-api, linux-doc, linux-mm, lkml

On Thu, Jan 19, 2023 at 01:22:42PM -0800, Rick Edgecombe wrote:
From: Yu-cheng Yu <redacted>

Setting CR4.CET is a prerequisite for utilizing any CET features, most of
which also require setting MSRs.

Kernel IBT already enables the CET CR4 bit when it detects IBT HW support
and is configured with kernel IBT. However, future patches that enable
userspace shadow stack support will need the bit set as well. So change
the logic to enable it in either case.

Clear MSR_IA32_U_CET in cet_disable() so that it can't live to see
userspace in a new kexec-ed kernel that has CR4.CET set from kernel IBT.

Tested-by: Pengfei Xu <redacted>
Tested-by: John Allen <john.allen@amd.com>
Signed-off-by: Yu-cheng Yu <redacted>
Reviewed-by: Kees Cook <redacted>

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help