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.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 1F8E7CA9EA0 for ; Tue, 22 Oct 2019 16:50:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E50DC2084B for ; Tue, 22 Oct 2019 16:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729869AbfJVQuM (ORCPT ); Tue, 22 Oct 2019 12:50:12 -0400 Received: from [217.140.110.172] ([217.140.110.172]:57528 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726024AbfJVQuL (ORCPT ); Tue, 22 Oct 2019 12:50:11 -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 D4F914AE; Tue, 22 Oct 2019 09:49:45 -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 AEF0D3F71A; Tue, 22 Oct 2019 09:49:43 -0700 (PDT) Date: Tue, 22 Oct 2019 17:49:36 +0100 From: Mark Rutland To: Kees Cook Cc: Sami Tolvanen , Will Deacon , Catalin Marinas , Steven Rostedt , Ard Biesheuvel , Dave Martin , Laura Abbott , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) Message-ID: <20191022164936.GA1451@lakrids.cambridge.arm.com> References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> <20191022162826.GC699@lakrids.cambridge.arm.com> <201910220929.ADF807CC@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201910220929.ADF807CC@keescook> 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 09:30:53AM -0700, Kees Cook wrote: > On Tue, Oct 22, 2019 at 05:28:27PM +0100, Mark Rutland wrote: > > On Fri, Oct 18, 2019 at 09:10:21AM -0700, Sami Tolvanen wrote: > > > +ifdef CONFIG_SHADOW_CALL_STACK > > > +KBUILD_CFLAGS += -fsanitize=shadow-call-stack > > > +DISABLE_SCS := -fno-sanitize=shadow-call-stack > > > +export DISABLE_SCS > > > +endif > > > > I think it would be preferable to follow the example of CC_FLAGS_FTRACE > > so that this can be filtered out, e.g. > > > > ifdef CONFIG_SHADOW_CALL_STACK > > CFLAGS_SCS := -fsanitize=shadow-call-stack > ^^^ was this meant to be CC_FLAGS_SCS here > > > KBUILD_CFLAGS += $(CFLAGS_SCS) > ^^^ and here? Whoops; yes in both cases... > > export CC_FLAGS_SCS > > endif > > > > ... with removal being: > > > > CFLAGS_REMOVE := $(CC_FLAGS_SCS) > > > > ... or: > > > > CFLAGS_REMOVE_obj.o := $(CC_FLAGS_SCS) > > > > That way you only need to define the flags once, so the enable and > > disable falgs remain in sync by construction. ^^^^^ "flags" here, too. Mark. 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.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 5AABDCA9EA0 for ; Tue, 22 Oct 2019 16:50:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 200B42084B for ; Tue, 22 Oct 2019 16:50:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dWXSOlxs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 200B42084B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WI3uCnrOWIsg7qcwlEBDzJRsZLX0FGxEIsu1PoqeOJ4=; b=dWXSOlxsDAbRbg P0q48zGn9Bo3vcBotlV1d1pBlCUkHB+inhaLhLjNlCXl3PFKBhr7G8DP++7sQl6xA6KSDeiWMv0Q2 Se/hivdaje1yDX+NBpXmqkkpY/h753/44bE2ei/W3pRZ9VnOHltFQ8J5MNfHv/tJrV4FjHLQCuC5J n0XiHpqE3MC+fxEdv6g37j+JexmVUxZGzrXl4zEIQ21+T3S7Lbc4g0c0w0BEwz23vJHxVIPeDMqG2 637tQXKRO+MKmvcP/0dYvN7hwsGAObRyYDyTJzcBxeQEWb38eAJDDwRjgePB3csHO6GU/7JxzYX04 vmtfvvgEUuTXa2gURnDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMxM8-0003kQ-FL; Tue, 22 Oct 2019 16:50:00 +0000 Received: from [217.140.110.172] (helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMxM5-0003jo-LG for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2019 16:49:59 +0000 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 D4F914AE; Tue, 22 Oct 2019 09:49:45 -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 AEF0D3F71A; Tue, 22 Oct 2019 09:49:43 -0700 (PDT) Date: Tue, 22 Oct 2019 17:49:36 +0100 From: Mark Rutland To: Kees Cook Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) Message-ID: <20191022164936.GA1451@lakrids.cambridge.arm.com> References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> <20191022162826.GC699@lakrids.cambridge.arm.com> <201910220929.ADF807CC@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201910220929.ADF807CC@keescook> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191022_094957_740098_CEFB8A12 X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Catalin Marinas , kernel-hardening@lists.openwall.com, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, Sami Tolvanen , Laura Abbott , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 22, 2019 at 09:30:53AM -0700, Kees Cook wrote: > On Tue, Oct 22, 2019 at 05:28:27PM +0100, Mark Rutland wrote: > > On Fri, Oct 18, 2019 at 09:10:21AM -0700, Sami Tolvanen wrote: > > > +ifdef CONFIG_SHADOW_CALL_STACK > > > +KBUILD_CFLAGS += -fsanitize=shadow-call-stack > > > +DISABLE_SCS := -fno-sanitize=shadow-call-stack > > > +export DISABLE_SCS > > > +endif > > > > I think it would be preferable to follow the example of CC_FLAGS_FTRACE > > so that this can be filtered out, e.g. > > > > ifdef CONFIG_SHADOW_CALL_STACK > > CFLAGS_SCS := -fsanitize=shadow-call-stack > ^^^ was this meant to be CC_FLAGS_SCS here > > > KBUILD_CFLAGS += $(CFLAGS_SCS) > ^^^ and here? Whoops; yes in both cases... > > export CC_FLAGS_SCS > > endif > > > > ... with removal being: > > > > CFLAGS_REMOVE := $(CC_FLAGS_SCS) > > > > ... or: > > > > CFLAGS_REMOVE_obj.o := $(CC_FLAGS_SCS) > > > > That way you only need to define the flags once, so the enable and > > disable falgs remain in sync by construction. ^^^^^ "flags" here, too. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel