From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H.J. Lu" Subject: Re: [PATCH 5/7] x86: Insert endbr32/endbr64 to vDSO Date: Thu, 7 Jun 2018 17:31:34 -0700 Message-ID: References: <20180607143855.3681-1-yu-cheng.yu@intel.com> <20180607143855.3681-6-yu-cheng.yu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Yu-cheng Yu , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "Shanbhogue, Vedvyas" , "Ravi V. Shankar" , Dave Hansen , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , mike.kravetz@oracle.com List-Id: linux-arch.vger.kernel.org On Thu, Jun 7, 2018 at 4:00 PM, Andy Lutomirski wrote: > On Thu, Jun 7, 2018 at 3:03 PM H.J. Lu wrote: >> >> On Thu, Jun 7, 2018 at 1:50 PM, Andy Lutomirski wrote: >> > On Thu, Jun 7, 2018 at 7:42 AM Yu-cheng Yu wrote: >> >> >> >> From: "H.J. Lu" >> >> >> >> When Intel indirect branch tracking is enabled, functions in vDSO which >> >> may be called indirectly should have endbr32 or endbr64 as the first >> >> instruction. We try to compile vDSO with -fcf-protection=branch -mibt >> >> if possible. Otherwise, we insert endbr32 or endbr64 by hand to assembly >> >> codes generated by the compiler. >> > >> > Wow, that's... a genuine abomination. Do we really need to support >> > CET on kernels built with old toolchains? >> > >> >> Yes. GCC 7 should be able to build CET kernel. >> > > Why? Presumably people running distros that use CET are going to have > kernels build with a CET-supporting compiler. > Good point. It was needed before GCC 8 was released. We can drop arch/x86/entry/vdso/endbr.sh now. -- H.J. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f66.google.com ([209.85.218.66]:35956 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752364AbeFHAbg (ORCPT ); Thu, 7 Jun 2018 20:31:36 -0400 MIME-Version: 1.0 In-Reply-To: References: <20180607143855.3681-1-yu-cheng.yu@intel.com> <20180607143855.3681-6-yu-cheng.yu@intel.com> From: "H.J. Lu" Date: Thu, 7 Jun 2018 17:31:34 -0700 Message-ID: Subject: Re: [PATCH 5/7] x86: Insert endbr32/endbr64 to vDSO Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Yu-cheng Yu , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "Shanbhogue, Vedvyas" , "Ravi V. Shankar" , Dave Hansen , Jonathan Corbet , Oleg Nesterov , Arnd Bergmann , mike.kravetz@oracle.com Message-ID: <20180608003134.jdN13_IDgEw__Nuq7zgWT4t_sh2Vh4V2Nbgf_7m4T7Q@z> On Thu, Jun 7, 2018 at 4:00 PM, Andy Lutomirski wrote: > On Thu, Jun 7, 2018 at 3:03 PM H.J. Lu wrote: >> >> On Thu, Jun 7, 2018 at 1:50 PM, Andy Lutomirski wrote: >> > On Thu, Jun 7, 2018 at 7:42 AM Yu-cheng Yu wrote: >> >> >> >> From: "H.J. Lu" >> >> >> >> When Intel indirect branch tracking is enabled, functions in vDSO which >> >> may be called indirectly should have endbr32 or endbr64 as the first >> >> instruction. We try to compile vDSO with -fcf-protection=branch -mibt >> >> if possible. Otherwise, we insert endbr32 or endbr64 by hand to assembly >> >> codes generated by the compiler. >> > >> > Wow, that's... a genuine abomination. Do we really need to support >> > CET on kernels built with old toolchains? >> > >> >> Yes. GCC 7 should be able to build CET kernel. >> > > Why? Presumably people running distros that use CET are going to have > kernels build with a CET-supporting compiler. > Good point. It was needed before GCC 8 was released. We can drop arch/x86/entry/vdso/endbr.sh now. -- H.J.