From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbcDUKj1 (ORCPT ); Thu, 21 Apr 2016 06:39:27 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37319 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbcDUKjX (ORCPT ); Thu, 21 Apr 2016 06:39:23 -0400 MIME-Version: 1.0 In-Reply-To: <1461234772-31832-1-git-send-email-aryabinin@virtuozzo.com> References: <1461234772-31832-1-git-send-email-aryabinin@virtuozzo.com> From: Dmitry Vyukov Date: Thu, 21 Apr 2016 12:39:02 +0200 Message-ID: Subject: Re: [PATCH] kcov: disable tracing and branch profiling in kcov To: Andrey Ryabinin Cc: Andrew Morton , LKML , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 21, 2016 at 12:32 PM, Andrey Ryabinin wrote: > Tracing of __sanitizer_cov_trace_pc() causes unbound recursion and crash, > because __sanitizer_cov_trace_pc() is also called from tracer code. > For the same reason we need to disable profiling of 'if' branches. > > Signed-off-by: Andrey Ryabinin > --- > kernel/kcov.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/kcov.c b/kernel/kcov.c > index 3efbee0..7919253 100644 > --- a/kernel/kcov.c > +++ b/kernel/kcov.c > @@ -1,5 +1,6 @@ > #define pr_fmt(fmt) "kcov: " fmt > > +#define DISABLE_BRANCH_PROFILING > #include > #include > #include > @@ -43,7 +44,7 @@ struct kcov { > * Entry point from instrumented code. > * This is called once per basic-block/edge. > */ > -void __sanitizer_cov_trace_pc(void) > +notrace void __sanitizer_cov_trace_pc(void) > { > struct task_struct *t; > enum kcov_mode mode; > -- > 2.7.3 There was a similar patch "kcov: Don't trace the code coverage code" recently. But it did not add DISABLE_BRANCH_PROFILING.