Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp601836imu; Thu, 13 Dec 2018 00:55:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vltc3z1b0404ebJFcg81Jf/Eyjr8OQctj9t051gjv1WmLL3hxycF0yyDcoKgno0fjX3baQ X-Received: by 2002:a62:d005:: with SMTP id p5mr23296824pfg.175.1544691313347; Thu, 13 Dec 2018 00:55:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544691313; cv=none; d=google.com; s=arc-20160816; b=u5mHIRKXapSX6bndLb/6oMgnVDt4aOXoo/F5khPGwZ5wBwTZUviC4iAD2nxRV0TN4Y s7ajZbFR9F+cAxgy8/OmInzsB5pKkv6k6r4OoI5vDVQFihVwz55BVRW7P+oi5DcSkZjP c4W2C/pQ92nMCWIDwJMHdNheeYHFT0Vf923oUEP+ahNnyM84rT4dsmMxY6tYLidf27Qe QAmbbk0hQc0CvD4HmHxfuACr/fJWZ+Fm5v6gFZoTBmZArXdgg8mJr6Csbo7xRwOQb4ai 0NThfnRZU7cRhoknRWs8IFWmYorLxAgKg4XOx344i/JDgHuDacy8/rC7oxpg2h3h4bI9 0E8Q== 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=XHGJSjEk7zmVCf478WOfKCGMYVWOK4idxf90rWA+6mw=; b=mcLdaBfD0ad/TqwYk183ANqU5Bi2Itk5R9eolg9qN42T4ik8CS2PIL4oLg96t8oUtx CToRtQ918pBGnaQ60oATxOmy6DwDkfXVNzaIaZjE3w4nPAr+yGjyEZ8tNxjykqvsIg6/ /y07VoW3gb0IiU1E/JndvubTbkfUDPXbiulDSHxGu2jUr13ql30jy5h6Z1pxzkO6z3eY WbzFYYcQ86fVOyJBlxFwe43NQIlGdQfryeaVBHF7pGokvLrlRGWYqsaE2r9bBIcVf2k6 tvZdNa53PV1fcBnIExd0A7XmGG/Iduj5Pnte6Yv4179b9sEMPwdXX56NKnib9qrYA7ln PZ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PTeZtCWV; 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 k12si1040236pgg.382.2018.12.13.00.54.58; Thu, 13 Dec 2018 00:55:13 -0800 (PST) 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=PTeZtCWV; 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 S1727476AbeLMIwt (ORCPT + 99 others); Thu, 13 Dec 2018 03:52:49 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:46234 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbeLMIwt (ORCPT ); Thu, 13 Dec 2018 03:52:49 -0500 Received: by mail-io1-f67.google.com with SMTP id v10so946491ios.13 for ; Thu, 13 Dec 2018 00:52:48 -0800 (PST) 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=XHGJSjEk7zmVCf478WOfKCGMYVWOK4idxf90rWA+6mw=; b=PTeZtCWV4okgM3V0fsmLlFhOce3tSJIG/qh8OZZfaKrkuBLI16cU/dt/dp1tW4xL4Q P2kwmI0LDTpRPNdbrNM9TxAmes8XCa7OIJxLHXwJXLb95iglnNh5PgFYlyUz9Iy1JOmF xiWhF5yxMr24Swq/WIXkr/Ek99s5RC4V2bXHQC5SKI6M6Oxh5SB4hRS1eCXLoiYNAg8j I7MGArdTy3aDVZskJ9cGgko6++2QjfAXss1EH9QrkfuHUEq/uvcENMeTYcRBD5CUYtZE Ke+vNmLgP65ZQ7brqnEnFg7kbIGS50YR7xrFjjI0ySi+5yuT5tazcz62wFWw5WEL38lz 3ITA== 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=XHGJSjEk7zmVCf478WOfKCGMYVWOK4idxf90rWA+6mw=; b=qYFX+SibHcpoYH/026NdbIpkvJjVtcr63oDpPHhW4IxV4z9QZgEuoX9GkPapQygUbz suPB72Of8uCkb4D/QCwvVLJ5IHmVX+Go00GwJb4EqxS6WsFAyOBAMitDQ5tkjDIFbz1Q D0QXzBTQQu4AzmfEXg2kE+qqBoWF0hlfYZ0L02Vx+AJCwHn7Ykg5KxCwwNMGfA9BqTCZ YlsjdWxNfc0osL2y6wMP+VKh51HqWeQuXruasfiw9MxF0/FpgR55oesre3fQOm981xpO pvk3tyD7qYhE+HiyjTyGDuBNJhoWzhjLpx0t+n366RNXgdJo3Vka0t1ZS9wtxwOkPpmH e5vA== X-Gm-Message-State: AA+aEWayXw40mqlbdvje+4HKA5Ivimio5k2oIf1TPBuELjP6tooTEKgp c+moxKhEQiKHBEKyvYa/Nrt/tQvf4K5yEEO+wsDJlQ== X-Received: by 2002:a5d:8491:: with SMTP id t17mr19384766iom.11.1544691168004; Thu, 13 Dec 2018 00:52:48 -0800 (PST) MIME-Version: 1.0 References: <20181212183447.15890-1-anders.roxell@linaro.org> In-Reply-To: <20181212183447.15890-1-anders.roxell@linaro.org> From: Dmitry Vyukov Date: Thu, 13 Dec 2018 09:52:36 +0100 Message-ID: Subject: Re: [PATCH v2] kasan: mark file common so ftrace doesn't trace it To: anders.roxell@linaro.org Cc: Andrey Ryabinin , kasan-dev , Linux-MM , LKML , Steven Rostedt 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 Wed, Dec 12, 2018 at 7:36 PM Anders Roxell wrote: > > When option CONFIG_KASAN is enabled toghether with ftrace, function > ftrace_graph_caller() gets in to a recursion, via functions > kasan_check_read() and kasan_check_write(). > > Breakpoint 2, ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:179 > 179 mcount_get_pc x0 // function's pc > (gdb) bt > #0 ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:179 > #1 0xffffff90101406c8 in ftrace_caller () at ../arch/arm64/kernel/entry-ftrace.S:151 > #2 0xffffff90106fd084 in kasan_check_write (p=0xffffffc06c170878, size=4) at ../mm/kasan/common.c:105 > #3 0xffffff90104a2464 in atomic_add_return (v=, i=) at ./include/generated/atomic-instrumented.h:71 > #4 atomic_inc_return (v=) at ./include/generated/atomic-fallback.h:284 > #5 trace_graph_entry (trace=0xffffffc03f5ff380) at ../kernel/trace/trace_functions_graph.c:441 > #6 0xffffff9010481774 in trace_graph_entry_watchdog (trace=) at ../kernel/trace/trace_selftest.c:741 > #7 0xffffff90104a185c in function_graph_enter (ret=, func=, frame_pointer=18446743799894897728, retp=) at ../kernel/trace/trace_functions_graph.c:196 > #8 0xffffff9010140628 in prepare_ftrace_return (self_addr=18446743592948977792, parent=0xffffffc03f5ff418, frame_pointer=18446743799894897728) at ../arch/arm64/kernel/ftrace.c:231 > #9 0xffffff90101406f4 in ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:182 > Backtrace stopped: previous frame identical to this frame (corrupt stack?) > (gdb) > > Rework so that the kasan implementation isn't traced. Acked-by: Dmitry Vyukov Thanks! > Signed-off-by: Anders Roxell > --- > mm/kasan/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile > index 0a14fcff70ed..e2bb06c1b45e 100644 > --- a/mm/kasan/Makefile > +++ b/mm/kasan/Makefile > @@ -5,6 +5,7 @@ UBSAN_SANITIZE_generic.o := n > UBSAN_SANITIZE_tags.o := n > KCOV_INSTRUMENT := n > > +CFLAGS_REMOVE_common.o = -pg > CFLAGS_REMOVE_generic.o = -pg > # Function splitter causes unnecessary splits in __asan_load1/__asan_store1 > # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533 > -- > 2.19.2 >