Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp609996ybm; Fri, 29 May 2020 08:01:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpsAszPZQ1Ow8yCPdyDcZBwNvOszCL8HtL8erXtTqApVqH6BVkkLn6KrqMl8pqvn5aplyh X-Received: by 2002:a17:906:851a:: with SMTP id i26mr8395311ejx.469.1590764465914; Fri, 29 May 2020 08:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590764465; cv=none; d=google.com; s=arc-20160816; b=A3BWY6cDTlC8h66yI6sQ+XjzXtohjIB2G7AoOx+6A1Bf+ThviZA76/+H0Y5+8RY6w1 R9htGCmjN5baGyyJdAT28oORX7i1y2X8885PS76KxxPPQUAqUhi3qIJRDVlxgJWOIARI R4w4eD1y/sfbSadK3VXtNbUS4RiudpQnTGroMcBuB2xSnBJ80J6bG9n3tpqnGUXhMtOs mYYZRo/N3HQd/fZ0bCngPATnP73K+IWvT881Qxf6hWLCOmfdFzZQsSCVygS0Wwp/HOiR GFyJpMLs5krEDg1/hla7ytNHLMSDulIJAfoUTdXSh9QG0qhW7RvoqMtMOovTsRSXNvUr 7pxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bTRjknFZ9qzPfihryROjWMbhSeglLc+Gkjpy43aIAlk=; b=W4UATdAFdlVCPLDWHTXjEed7PY6LZcbkWPkY4xIOXTTGxsLrOhvWZloEkA4KgzKXwf eccUqSxrC//cCdSsfv67NA9kULA/QMwCF9JO7z2KNyxoa69RI6x7J6GijsctBpJhf2Q/ zVua98qifgV+MFZfNXHSGEUwFm1ndwgRKAK/h37gCno2qDJRAyiNVbqE1iXVih5rSsip nDuLrucmSIarG2vIp8WrsnLBygZeyvnQrNnPQI74Rvz/nRY6B4HwERnHxKLHgA1eFeG4 P79iZSyYwT11oKpiZuj/gKs9g7yGKiHd8oGTODEERkoD2D0WXGTe+Q8mG2Jdd1bnr93O 8QbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bw8wnVbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si5436789edq.147.2020.05.29.08.00.41; Fri, 29 May 2020 08:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bw8wnVbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbgE2O41 (ORCPT + 99 others); Fri, 29 May 2020 10:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgE2O41 (ORCPT ); Fri, 29 May 2020 10:56:27 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 095B5C03E969 for ; Fri, 29 May 2020 07:56:27 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id a7so2428515oic.6 for ; Fri, 29 May 2020 07:56:26 -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=bTRjknFZ9qzPfihryROjWMbhSeglLc+Gkjpy43aIAlk=; b=Bw8wnVbkJ4eFG5S0/yvHVX3yM808HVhZWnbP0E4cwEACib0swhqcBFNyibum2MJNvJ X9cloOyMS5BoAvjgYih03f1Hx+hqv0+1LfiJqqfUAbvLShlO3RDnNrEPFXrOSgpw1oB9 d7ZhoA9CSxzCirz8GdpTLOpaVMUY+W5ZgvaisubXYQxx/QMEdw4hFqS2i9hiGvm9QVkc AVx2yhw1E09qnmkhBl0YtwDUyUFhZaxB3iFAxB4GJ6PTgdf6jliEMTxQ+sqNZR22+Q9X 3Y4kJMW2QH2d9d8mIf25Lo+f7CEJDAQ2Rsbd/9NnkRR4oSkvdHtzbLIM5VE3JPlyzZWQ Vxdg== 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=bTRjknFZ9qzPfihryROjWMbhSeglLc+Gkjpy43aIAlk=; b=YJUopMJ6qp4h3a+676tr9WKhA0zhSUsBAw1Tmv+thJS0xwWtH+wH1dRSBsTFcMa4r/ i6Bw0A7vZ+gsZMj4UJeG+CWmGBQ2lixTJaEuBT1TUPtDUwgcevdNPGlcW/WDN7QLUebP gBy3FP0RXy3aO0VxqMmZ6nRnlcqZvnN20kVKlyMLyNpqRSDIKvL+mngUGkrxU9HQxpfU X9PY3EvI7YHgscBN4iIbGQ6RPr5JHJR9rDqlGzbqTh+gIkqVAzA/0CplxHSy43gWTlo/ 5hfy55KZFXq+wF4ZrnJOMJN6Vp0WLMrWghhVIeTQGlM71ZSYGlGJVMbPdxySrHcHQn4L hskA== X-Gm-Message-State: AOAM533ugxG8MS9qB/m1YQVTRdSFb57YNWXtCVaAmGCtJ6PM3F2u861k +dWk42BKLpKlX3gDU1jhq1HffIlZKxrBylzfp5mL8Q== X-Received: by 2002:aca:d0d:: with SMTP id 13mr6056826oin.172.1590764181216; Fri, 29 May 2020 07:56:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Marco Elver Date: Fri, 29 May 2020 16:56:09 +0200 Message-ID: Subject: Re: [PATCH] kasan: fix clang compilation warning due to stack protector To: Andrey Konovalov 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > +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.