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=-12.7 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLACK, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 C9B3EC433E0 for ; Fri, 29 May 2020 19:13:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F35220723 for ; Fri, 29 May 2020 19:13:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SV7JaaRY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F35220723 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1E1828001A; Fri, 29 May 2020 15:13:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BEA780010; Fri, 29 May 2020 15:13:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F3928001A; Fri, 29 May 2020 15:13:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id ED86F80010 for ; Fri, 29 May 2020 15:13:38 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AF4AA3AA7 for ; Fri, 29 May 2020 19:13:38 +0000 (UTC) X-FDA: 76870705716.25.route64_59e2be2173e4e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 111C21804E3AD for ; Fri, 29 May 2020 19:13:37 +0000 (UTC) X-HE-Tag: route64_59e2be2173e4e X-Filterd-Recvd-Size: 6770 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 May 2020 19:13:37 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id q16so1618411plr.2 for ; Fri, 29 May 2020 12:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oaFnjUA4dY+z1OHe26Jg20HjGUXEg7dL6NAWsqRKEyg=; b=SV7JaaRYNYenoJaDIipJhEAoLQG6IXkyOEfZg5vhA9CdIAgkh80aEx48FdnSD+xb0u sZojVzgEitVYnOi28MIy/qWtXexVx0c954swi+d1FV4LKLu9RbL2XqWSsEFejPGcq+IT 8l26NXBdFqVCRTAmkAcnYNJndFLPOux5GapAYeuLePPNF1xAJ73uEC6erI4oTwIvaAwh FTn80jqj74uIMvKpjszsIqTZkg4YXeV601sOwArRNCG5Av8P40FjLs+8BCopVxah/TR5 1ZFWCVZnS0HCje3NGBICSm5VbiB7VPUgJWztTatu6zIAugSsqX5Wmq3rIYruCp0ZaNOu 6P+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oaFnjUA4dY+z1OHe26Jg20HjGUXEg7dL6NAWsqRKEyg=; b=qIAYf2rciHRKfRcRX8VNzhbjX/tKhB9fTI7Yl1nF+mwyGb7awRzdVf1RfBOJUiMklf 1RjMe0WawO44TjbxA2gRG6skPG9XqPhOvMSMg3F9ycsdhKQqTaeFTgDa6ab5985PoWU3 z12d6ku5CWVnSmQsVoKoIXBiNwt7rJygR96NC7lK84q+4NR7GTgOqBquCHE4FWQ0ouja AH4EWOqKBi9IrMAo+ZkJtpb1ub6naD8gVWqlHI4IFGxeexfpjWqrCfSqN5V6kWu2w7Oj w/+itKPL/fHyC9DacEbY5ztkkR847IhoNzOIda3ji2C9Mag/V3Sj82P+izWANuC7n9Ab eWbw== X-Gm-Message-State: AOAM533djFP8Qxzls5gizrBqAblM9Waudy38zfhw+PmAHYF5mb0Y5LB/ 02rXdnNOvj2aSJPr/x1aDp9PDpfC4U0OCzcSCcc4Lw== X-Google-Smtp-Source: ABdhPJxM1af5vMs+j6j9U6LtukVH5C12f/WIPpriOWLUdLaaM2iK0hRts3/WmQ+NStv/xsSPalR/eRloaZ1kt3RZCVU= X-Received: by 2002:a17:90a:2a8e:: with SMTP id j14mr10688817pjd.136.1590779614972; Fri, 29 May 2020 12:13:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Fri, 29 May 2020 21:13:23 +0200 Message-ID: Subject: Re: [PATCH] kasan: fix clang compilation warning due to stack protector To: Marco Elver Cc: Andrew Morton , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev , Linux Memory Management List , LKML , Qian Cai Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 111C21804E3AD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 29, 2020 at 4:56 PM Marco Elver wrote: > > On Thu, 28 May 2020 at 19:20, 'Andrey Konovalov' via kasan-dev > wrote: > > > > KASAN uses a single cc-option invocation to disable both conserve-stack > > and stack-protector flags. The former flag is not present in Clang, which > > causes cc-option to fail, and results in stack-protector being enabled. > > > > Fix by using separate cc-option calls for each flag. Also collect all > > flags in a variable to avoid calling cc-option multiple times for > > different files. > > > > Reported-by: Qian Cai > > Signed-off-by: Andrey Konovalov > > --- > > Thank you! I was about to send an almost identical patch, as I > encountered this when using clang. > > Reviewed-by: Marco Elver > > > mm/kasan/Makefile | 21 +++++++++++++-------- > > 1 file changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile > > index de3121848ddf..bf6f7b1f6b18 100644 > > --- a/mm/kasan/Makefile > > +++ b/mm/kasan/Makefile > > @@ -15,14 +15,19 @@ CFLAGS_REMOVE_tags_report.o = $(CC_FLAGS_FTRACE) > > > > # Function splitter causes unnecessary splits in __asan_load1/__asan_store1 > > # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533 > > -CFLAGS_common.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_generic.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_generic_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_init.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_quarantine.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_tags.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > -CFLAGS_tags_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING > > +CC_FLAGS_KASAN_CONFLICT := $(call cc-option, -fno-conserve-stack) > > +CC_FLAGS_KASAN_CONFLICT += $(call cc-option, -fno-stack-protector) > > +# Disable branch tracing to avoid recursion. > > +CC_FLAGS_KASAN_CONFLICT += -DDISABLE_BRANCH_PROFILING > > Note that maybe CC_FLAGS_KASAN_RUNTIME could be a better name, because > other flags added in future might not be conflict-related. But until > that future, it doesn't really matter. CC_FLAGS_KASAN_RUNTIME is a better name, sent v2, thanks! > > > +CFLAGS_common.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_generic.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_generic_report.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_init.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_quarantine.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_report.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_tags.o := $(CC_FLAGS_KASAN_CONFLICT) > > +CFLAGS_tags_report.o := $(CC_FLAGS_KASAN_CONFLICT) > > > > obj-$(CONFIG_KASAN) := common.o init.o report.o > > obj-$(CONFIG_KASAN_GENERIC) += generic.o generic_report.o quarantine.o > > -- > > 2.27.0.rc0.183.gde8f92d652-goog > > > > -- > > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/ced83584eec86a1a9ce264013cf6c0da5e0add6a.1590686292.git.andreyknvl%40google.com.