From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6618CA9EAF for ; Thu, 24 Oct 2019 13:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C199F2166E for ; Thu, 24 Oct 2019 13:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393588AbfJXN2w (ORCPT ); Thu, 24 Oct 2019 09:28:52 -0400 Received: from foss.arm.com ([217.140.110.172]:51362 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388733AbfJXN2w (ORCPT ); Thu, 24 Oct 2019 09:28:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A65C3C8F; Thu, 24 Oct 2019 06:28:36 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 004113F71A; Thu, 24 Oct 2019 06:28:34 -0700 (PDT) Date: Thu, 24 Oct 2019 14:28:32 +0100 From: Mark Rutland To: Sami Tolvanen Cc: Will Deacon , Catalin Marinas , Steven Rostedt , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Nick Desaulniers , clang-built-linux , Kernel Hardening , linux-arm-kernel , LKML Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) Message-ID: <20191024132832.GG4300@lakrids.cambridge.arm.com> References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> <20191022162826.GC699@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 22, 2019 at 12:26:02PM -0700, Sami Tolvanen wrote: > On Tue, Oct 22, 2019 at 9:28 AM Mark Rutland wrote: > > > +config SHADOW_CALL_STACK > > > + bool "Clang Shadow Call Stack" > > > + depends on ARCH_SUPPORTS_SHADOW_CALL_STACK > > > + depends on CC_IS_CLANG && CLANG_VERSION >= 70000 > > > > Is there a reason for an explicit version check rather than a > > CC_HAS_ check? e.g. was this available but broken in prior > > versions of clang? > > No, this feature was added in Clang 7. However, > -fsanitize=shadow-call-stack might require architecture-specific > flags, so a simple $(cc-option, -fsanitize=shadow-call-stack) in > arch/Kconfig is not going to work. I could add something like this to > arch/arm64/Kconfig though: > > select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK > ... > config CC_HAVE_SHADOW_CALL_STACK > def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18) > > And then drop CC_IS_CLANG and version check entirely. Thoughts? That sounds good to me, yes! Thanks, Mark.