Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4057955ybi; Mon, 3 Jun 2019 05:07:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoietO+rplamY9JYhLyp3dNUnlZTnVUU+0sl2KgNryOMIeVk+SHCnfh4DBw/cat7kdyPh0 X-Received: by 2002:a62:fb0a:: with SMTP id x10mr7812419pfm.224.1559563656321; Mon, 03 Jun 2019 05:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559563656; cv=none; d=google.com; s=arc-20160816; b=IYSMWySmnVzFOrDygxqi/WkVDkWGmtTNupE2tnHY9yNL3B6jtAyFgg5a3ZRSW7tY7F uIuhXXDnpNfB+0chRMCuwBHrisrlKdoWeUd3h5gG0ZbrmZ6hVrpkIeGb4m8i6yYKoesV 7ec5hEX+L66d2Weqz498W9DvjzgJ9m/pAbmfq0H9X+pPA7bHD+7JvrY3ItligzsFh2wb GZuLWhtwiMZ3U5UJbO1WLPJ0z7ki9N7mn7bWkdBRg7RWPkDPF2oxxYWw8CDCayKzpGa/ +TMtka8+H4lTz+RJ63j87x18KMlQTsBUI0taippnoK5NUwzSA5Rq3/Pd2yZDxYEI+L8v c33w== 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=JVlFqe9K3dpzMXBqO3onEIwgqdoMrC9jSiKlsTsm+KA=; b=r0cR1FLupBNwNhXnfgLr1gRXUzAn9X2gH/RwmHKNjMMfh4Hm4tw4VERCd/D0ogUZyI FwYQ6vYi/Jm3O/spxnxrDP54vCUZn/A1KBCItr6mHhZKCrcojL78VHHbOWotvK/OMbd+ 6xeupfJw1awi16s6s5QfGVEFaFxlERhkpSySBEju1xDgrkmQRNdTdWk4Q8Gxk69KoESH MXSlIcHFb5nVcBCW6Xd/C0EAZQc8kxziZXRIRmPHnQEldA+1yTJP/regzXZgSPTxys1/ pbMaS8/76HPShiu01o0I7wgVk+nXJ9zXKfEiv2mjn9WwwzwHaGd3V2meIsE2uvZ7vewt 0M9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ui2HFJbr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j6si17974093plk.120.2019.06.03.05.07.16; Mon, 03 Jun 2019 05:07:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ui2HFJbr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727606AbfFCKvJ (ORCPT + 99 others); Mon, 3 Jun 2019 06:51:09 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:38877 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727565AbfFCKvJ (ORCPT ); Mon, 3 Jun 2019 06:51:09 -0400 Received: by mail-it1-f193.google.com with SMTP id h9so11624443itk.3 for ; Mon, 03 Jun 2019 03:51:09 -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=JVlFqe9K3dpzMXBqO3onEIwgqdoMrC9jSiKlsTsm+KA=; b=ui2HFJbrMgcbCdCR8lZgDXCgpVlJzmJXm/yjyCdTymvUROCbMa4Sn8GwY7R7f3EgB5 3LXWiuPFHS2SgZK4rx+XDHRSzfiCdz0woo61aiXKUI1EZG9g5o5pWXCF2B6sRHkaatZz H6W6O9pmWNtDwlcayUPBzd1lk8bZSA+KMNMwU18GgkiK9gZ3B63kyCncCg+wcbusVhAN z83V7dT6ZkXWAdsr0+V3pUhf2OmJMgW5cxtMYwqRd4N6CMX/ffZqGL2hyONTMhikX59n /1fizGKsZ/2l5bRBYZNxNpyO/8E3AWVOQGJsb+/2E41ukfV+U6TiSMeUFUpRLPwjDI1Q mkkA== 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=JVlFqe9K3dpzMXBqO3onEIwgqdoMrC9jSiKlsTsm+KA=; b=AiphLZoPpe76I6GnvAO/BUSp5DiIH2+LBVSa1KEncqjLiRZdIL8tDt1lHpb/FaDm9Q 3P6PKW5xHDGbOlBcQKzw2HYZgJExmKTDFwcqR9HkbzmMpwbgU9uXunRlvqGtjXMvXqJY ew5OWoFxC7PeWIyM53WQcUSDQOMdtd4OXFMFYmrp0H45I/ta5kNT2/Cj7v890jZpHUgV 1gYPekhnioLj8XcvvvKWcUeAWL7Q2f6l7bt6VhoyuJ4Df3+ERw24YKYYraOix5ebfGo0 HdTYonjdRC35q8suzvPGY6B97K/RChPjNu9zjKYJ0hej1QFMqehcKHEDjsK1xW5sFTDU BVnw== X-Gm-Message-State: APjAAAXl3dv80/EMWQeJeZLf1TWHjPS/5hd3MXcSw7Ood1kWO2FpOMts gtNdiNrSenRdBmwjtYr58W38iLtVOz2s9v9h6pFJXg== X-Received: by 2002:a02:22c6:: with SMTP id o189mr3896549jao.35.1559559068416; Mon, 03 Jun 2019 03:51:08 -0700 (PDT) MIME-Version: 1.0 References: <20190603091148.24898-1-anders.roxell@linaro.org> In-Reply-To: <20190603091148.24898-1-anders.roxell@linaro.org> From: Dmitry Vyukov Date: Mon, 3 Jun 2019 12:50:56 +0200 Message-ID: Subject: Re: [PATCH] mm: kasan: mark file report so ftrace doesn't trace it To: Anders Roxell Cc: Andrey Ryabinin , kasan-dev , Linux-MM , LKML , Thomas Gleixner , Ingo Molnar 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 Mon, Jun 3, 2019 at 11:11 AM Anders Roxell wrote: > > __kasan_report() triggers ftrace and the preempt_count() in ftrace > causes a call to __asan_load4(), breaking the circular dependency by > making report as no trace for ftrace. > > Signed-off-by: Anders Roxell > --- > mm/kasan/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile > index 08b43de2383b..2b2da731483c 100644 > --- a/mm/kasan/Makefile > +++ b/mm/kasan/Makefile > @@ -3,12 +3,14 @@ KASAN_SANITIZE := n > UBSAN_SANITIZE_common.o := n > UBSAN_SANITIZE_generic.o := n > UBSAN_SANITIZE_generic_report.o := n > +UBSAN_SANITIZE_report.o := n > UBSAN_SANITIZE_tags.o := n > KCOV_INSTRUMENT := n > > CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_generic.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_generic_report.o = $(CC_FLAGS_FTRACE) > +CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_tags.o = $(CC_FLAGS_FTRACE) > > # Function splitter causes unnecessary splits in __asan_load1/__asan_store1 > @@ -17,6 +19,7 @@ CFLAGS_REMOVE_tags.o = $(CC_FLAGS_FTRACE) > CFLAGS_common.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > CFLAGS_generic.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > CFLAGS_generic_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > +CFLAGS_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > CFLAGS_tags.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > > obj-$(CONFIG_KASAN) := common.o init.o report.o Acked-by: Dmitry Vyukov Is it needed in all section? Or you just followed the pattern? Different flag changes were initially done on very specific files for specific reasons. E.g. -fno-conserve-stack is only for performance reasons, so report* should not be there. But I see Peter already added generic_report.o there. Perhaps we need to give up on selective per-file changes, because this causes constant flow of new bugs in the absence of testing and just do something like: KASAN_SANITIZE := n KCOV_INSTRUMENT := n UBSAN_SANITIZE := n CFLAGS_REMOVE = $(CC_FLAGS_FTRACE) CFLAGS := $(call cc-option, -fno-conserve-stack -fno-stack-protector)