From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC PATCH v9 05/27] x86/cet/shstk: Add Kconfig option for user-mode Shadow Stack protection Date: Thu, 27 Feb 2020 10:03:36 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mga11.intel.com ([192.55.52.93]:48746 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgB0SDh (ORCPT ); Thu, 27 Feb 2020 13:03:37 -0500 In-Reply-To: Content-Language: en-US Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski , "H.J. Lu" Cc: Yu-cheng Yu , the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , Jann Horn , Jonathan Corbet , Kees Cook 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com ([192.55.52.93]:48746 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbgB0SDh (ORCPT ); Thu, 27 Feb 2020 13:03:37 -0500 Subject: Re: [RFC PATCH v9 05/27] x86/cet/shstk: Add Kconfig option for user-mode Shadow Stack protection References: From: Dave Hansen Message-ID: Date: Thu, 27 Feb 2020 10:03:36 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski , "H.J. Lu" Cc: Yu-cheng Yu , the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , x86-patch-review@intel.com Message-ID: <20200227180336.i7VomPFQqQfFwkZBo-tXuhhOXx94coBbiXlDInXYHyg@z> 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?