Re: [RFC PATCH v9 05/27] x86/cet/shstk: Add Kconfig option for user-mode Shadow Stack protection

From: Dave Hansen
Date: Thu Feb 27 2020 - 13:03:39 EST


On 2/26/20 7:57 PM, Andy Lutomirski wrote:
>> GCC 8 or above is needed since vDSO must be compiled with
>> --fcf-protection=branch.
> Fair enough. I donât particularly want to carry a gross hack to add
> the ENDBRANCHes without compiler support.

Yeah, that's not worth it.

But my main issue the shadow stack instructions:

>> +ifdef CONFIG_X86_INTEL_SHADOW_STACK_USER
>> + ifeq ($(call as-instr, saveprevssp, y),)
>> + $(error CONFIG_X86_INTEL_SHADOW_STACK_USER not supported by the assembler)
>> + endif
>> +endif

Which are unrelated to ENDBRANCH.

But, in any case, let's say Kconfig says we should try to use IBT, but
we get to building the vDSO and don't have the right toolchain. Do we
just stop the build? Or do we let the build go on and then decline to
let folks enable IBT at runtime?