Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp69386ybr; Fri, 22 May 2020 00:58:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz669tfwUwEVN4EinEX3wuZF1rBvh3G04KdviBOAW21MTUbfy4w5htl1thvNFhAo0n20X4k X-Received: by 2002:a50:ee0b:: with SMTP id g11mr1990248eds.114.1590134305836; Fri, 22 May 2020 00:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590134305; cv=none; d=google.com; s=arc-20160816; b=ecmy4J/uvxf28Fja5b0VHIzGcYveh6fRVv4bgF0q8R1J/tOZ3lszfuj/utr4haaHcu l9pzQR/0gHFA75ZMlnh8v/+LVQ+S10tw8hKtiuJ+n2vFO/dSwZpDgiyQLyHgWqAnvJPZ QCzmCEvSkRiAECqdW/kPjY7z5AQg8/8VkqyqD5G9ZL5C6KD8QrXjoyopAGw66ySeQzN+ foW4dvgPOxIPzoqNtxTDUoHa357sVch8nD8JoZV7Zmq8Uce0GuoH7UBOnWsnaTcBim0q VKT9ZKfuz4sWWDUv4xC8DpCDYmm/C0PTQR3YL+Y5ReIGf+mKwGlQPF9vhXpf/Hl6+Ih4 dCTg== 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=HDvjesLpXeZbOqZwVDwcodT/WLJvvTdpPsS1Pe0Kvbc=; b=mvOhQXRojeBCpmeA9ms1qmLYel0/ecC2EMWxA7r2Mb2G3LPY+qWklWQtYN5AszDLO5 lR+P7VcNSB657v/vjNruQzfMDg+9M13bntHMxQULfi/xRpPC56noJXRQfXxH9KLQgueI e0Em2gjZxJhqYiq/i2Vy9xpMJstki6ZTX5XcKFqwNbzLxEwpJXsLLMtghRebp2qMx2oN OYUyPJDgJp/fhE0OJE+Q/mWKKgI7my0matYMrUj0gHpwJ8ggJnN1yicRFE477Agz0mVq 7vKlTeLYLtpxI86Y4xiGhA6LBnX1fPVLnlaq4FK1TfGZIhG6Fydb3Zdkn65O/j57JaOX 9yxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Js0gHi2D; 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 c20si4026427edn.476.2020.05.22.00.58.03; Fri, 22 May 2020 00:58:25 -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=Js0gHi2D; 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 S1728918AbgEVHyW (ORCPT + 99 others); Fri, 22 May 2020 03:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728152AbgEVHyV (ORCPT ); Fri, 22 May 2020 03:54:21 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB9F7C061A0E for ; Fri, 22 May 2020 00:54:21 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id 23so7348844oiq.8 for ; Fri, 22 May 2020 00:54:21 -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=HDvjesLpXeZbOqZwVDwcodT/WLJvvTdpPsS1Pe0Kvbc=; b=Js0gHi2DTQXexCVkMMsYhKEUAtqsQlbamMG8UNpINiLEKQLXsSUxNqSgvgPf14hal3 Cr7pYIkHBer06P3K+5PRh4agENlFTgSahNc5+iggMr7ET47z/yWICl26a6zfOcGcrWZr GGhFLk0+IxVNvDfcDbY2RlgjIOIZTVtgYm1YDntFMLdfbs+GtT8Q6mqc/bVpj4lf8eHd vf6E0yIlumIhD9+RhHj3kVypUjknM861hAwo7tz+qajVzsmfqSvrvR7yitsY4yDPGAIV ugyi8jD7hPk7P3lObtJLvP6Y+QTjdAgUnFS0QwuzPWnXnlzqUnBX7hdPpuxe3jXn/+TT b0ew== 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=HDvjesLpXeZbOqZwVDwcodT/WLJvvTdpPsS1Pe0Kvbc=; b=Wco6ARey6ebfHS4VObz68tgBdOY8ZXwHoZ/JmkOu1AUHneZy+Rjm6t1OObvxk5SBhG yvPQN8a20zt6rVyFJfrYwwCss22ezby7I+nsMNrtznQsHAW+bqICZDS4sy2g0CvFn3Z1 DRCXuwKnoRumLDdQaJS/Bj07t2r9E42yx3TbaWuH8RXsr9XiToblSIm3lFjsQIHkILqA BIc71DUrodXFSPrs1Ke1VMewYwPaaMlcYsWel0UKUrkwrMrb2Icu6KyqZh2tgvp7a3BB 6uNjkVYvU0WDbI8grWYvbQJdhcJxUBs5rmV+X05iAZu2+Un29lF9ef4ndDvsBxr4WJAf Y+ew== X-Gm-Message-State: AOAM530mT6J5yRvbphEr3AaAaTUYQ+ex2ZMMcByAomkIeWpkLsp8T3TQ tPFrpIKXQSK18Q5nSc/4KoFMWj3GF7Y7L8focKmpSg== X-Received: by 2002:aca:3254:: with SMTP id y81mr1737976oiy.172.1590134060936; Fri, 22 May 2020 00:54:20 -0700 (PDT) MIME-Version: 1.0 References: <20200519182459.87166-1-elver@google.com> <20200521221133.GD6367@ovpn-112-192.phx2.redhat.com> In-Reply-To: <20200521221133.GD6367@ovpn-112-192.phx2.redhat.com> From: Marco Elver Date: Fri, 22 May 2020 09:54:09 +0200 Message-ID: Subject: Re: [PATCH] kasan: Disable branch tracing for core runtime To: Qian Cai Cc: Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , LKML , kasan-dev , Andrey Ryabinin , Andrew Morton , Linux Memory Management List , kernel test robot 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 Fri, 22 May 2020 at 00:11, Qian Cai wrote: > > On Tue, May 19, 2020 at 08:24:59PM +0200, 'Marco Elver' via kasan-dev wrote: > > During early boot, while KASAN is not yet initialized, it is possible to > > enter reporting code-path and end up in kasan_report(). While > > uninitialized, the branch there prevents generating any reports, > > however, under certain circumstances when branches are being traced > > (TRACE_BRANCH_PROFILING), we may recurse deep enough to cause kernel > > reboots without warning. > > > > To prevent similar issues in future, we should disable branch tracing > > for the core runtime. > > > > Link: https://lore.kernel.org/lkml/20200517011732.GE24705@shao2-debian/ > > Reported-by: kernel test robot > > Signed-off-by: Marco Elver > > --- > > mm/kasan/Makefile | 16 ++++++++-------- > > mm/kasan/generic.c | 1 - > > 2 files changed, 8 insertions(+), 9 deletions(-) > > > > diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile > > index 434d503a6525..de3121848ddf 100644 > > --- a/mm/kasan/Makefile > > +++ b/mm/kasan/Makefile > > @@ -15,14 +15,14 @@ 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) > > -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_init.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) > > -CFLAGS_quarantine.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) > > mm/kasan/tags.c:15:9: warning: 'DISABLE_BRANCH_PROFILING' macro redefined [-Wmacro-redefined] > #define DISABLE_BRANCH_PROFILING > ^ > :6:9: note: previous definition is here > #define DISABLE_BRANCH_PROFILING 1 > ^ > > This? > > diff --git a/mm/kasan/tags.c b/mm/kasan/tags.c > index 25b7734e7013..8a959fdd30e3 100644 > --- a/mm/kasan/tags.c > +++ b/mm/kasan/tags.c > @@ -12,7 +12,6 @@ > */ > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > -#define DISABLE_BRANCH_PROFILING > > #include > #include > I missed this one, thanks! Added this to v2. v2: https://lkml.kernel.org/r/20200522075207.157349-1-elver@google.com