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 835C3CA9EA0 for ; Tue, 22 Oct 2019 16:50:25 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id D1E782084B for ; Tue, 22 Oct 2019 16:50:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1E782084B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17091-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 9841 invoked by uid 550); 22 Oct 2019 16:50:18 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 9820 invoked from network); 22 Oct 2019 16:50:17 -0000 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) 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.