Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11025936imu; Thu, 6 Dec 2018 10:17:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/W5cQcbIifIQA3DkndqBTwF/X9Uz8hnJA7onFZJiYHwrC45ZXHMTkwiKeDh8xTnRqHXwTGa X-Received: by 2002:a62:5444:: with SMTP id i65mr30585216pfb.193.1544120233256; Thu, 06 Dec 2018 10:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544120233; cv=none; d=google.com; s=arc-20160816; b=D76wPprHC56DOtjk4CoPuuj2wPwzKM8lJqVoM0TXFAPf5ZwRkkEgRuLG4OyMoVgOgz sYLRKg0m5uQ5L1s1uVu2kFrpPH19sbcMiPqpYuDE+CRbI1HjhSBjE4flfWSAaQsilFNx /bX4rnNysXedt1l9uvB367cEP6fWfYu6oYaF1FeOoUN/ZfcBpnFjWIOEmmBB8pmmhdTz tqy7IMbw8Z/nG04q+HwpHtE7PADYORWwiCPcIkV7IWl5MO/bofTH1DUujj0zTuKD3Scw sqglt0lhRABumvmK8o0axBPCVo9K71bz7hwRxv5JDoxrGCBNKV2AMGPCh07KIPlio0De ACKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=aMn6APSaP2+ZdHTolR6WeO34PUXTWPLs2iEeK4WsZf0=; b=Jt0eWPzzMSc1MRJHVwRX1vnwgYmBfruHburqNsNqyroEebL5ByQkDw6XZwRrDTHfip HsMt0NptuPjePY2J9pPS6/l9KpEWS26s5XGQCHRIe8HU1bD7AAULz4WBzve8jYa3dcHL cWv81tPyyJ8vyEwzb4BqGBCa3usMBFrso0D+B4Cxo3WQ9an2xLF4lxXlq4OMqI8UBKC9 inYWzubkGwt+gK5sXBEMzxe6stNZIk/ZPqL4X65GyNfHUGb80WWPhevcl3nF+coI2kOa M/jO2td1K9jQr36oDKW7Gvw84Bak+YgFZOvwatEXn5kKRvAOLInAkVoAcqFetueXRSUP cBsQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si702735ply.359.2018.12.06.10.16.53; Thu, 06 Dec 2018 10:17: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725950AbeLFSOV (ORCPT + 99 others); Thu, 6 Dec 2018 13:14:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:53138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbeLFSOV (ORCPT ); Thu, 6 Dec 2018 13:14:21 -0500 Received: from vmware.local.home (unknown [208.91.3.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FCC020868; Thu, 6 Dec 2018 18:14:20 +0000 (UTC) Date: Thu, 6 Dec 2018 13:14:17 -0500 From: Steven Rostedt To: Anders Roxell Cc: akpm@linux-foundation.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH] kernel/kcov.c: mark func write_comp_data() as notrace Message-ID: <20181206131417.5019b1e8@vmware.local.home> In-Reply-To: <20181206143011.23719-1-anders.roxell@linaro.org> References: <20181206143011.23719-1-anders.roxell@linaro.org> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Dec 2018 15:30:11 +0100 Anders Roxell wrote: > Since __sanitizer_cov_trace_const_cmp4 is marked as notrace, the > function called from __sanitizer_cov_trace_const_cmp4 shouldn't be > traceable either. ftrace_graph_caller() gets called every time func > write_comp_data() gets called if it isn't marked 'notrace'. This is the > backtrace from gdb: > > #0 ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:179 > #1 0xffffff8010201920 in ftrace_caller () at ../arch/arm64/kernel/entry-ftrace.S:151 > #2 0xffffff8010439714 in write_comp_data (type=5, arg1=0, arg2=0, ip=18446743524224276596) at ../kernel/kcov.c:116 > #3 0xffffff8010439894 in __sanitizer_cov_trace_const_cmp4 (arg1=, arg2=) at ../kernel/kcov.c:188 > #4 0xffffff8010201874 in prepare_ftrace_return (self_addr=18446743524226602768, parent=0xffffff801014b918, frame_pointer=18446743524223531344) at ./include/generated/atomic-instrumented.h:27 > #5 0xffffff801020194c in ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:182 > > Rework so that write_comp_data() that are called from > __sanitizer_cov_trace_*_cmp*() are marked as 'notrace'. > > Commit 903e8ff86753 ("kernel/kcov.c: mark funcs in __sanitizer_cov_trace_pc() as notrace") > missed to mark write_comp_data() as 'notrace'. When that patch was > created gcc-7 was used. In lib/Kconfig.debug > config KCOV_ENABLE_COMPARISONS > depends on $(cc-option,-fsanitize-coverage=trace-cmp) > > That code path isn't hit with gcc-7. However, it were that with gcc-8. > > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Anders Roxell Acked-by: Steven Rostedt (VMware) -- Steve > --- > kernel/kcov.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/kcov.c b/kernel/kcov.c > index 97959d7b77e2..c2277dbdbfb1 100644 > --- a/kernel/kcov.c > +++ b/kernel/kcov.c > @@ -112,7 +112,7 @@ void notrace __sanitizer_cov_trace_pc(void) > EXPORT_SYMBOL(__sanitizer_cov_trace_pc); > > #ifdef CONFIG_KCOV_ENABLE_COMPARISONS > -static void write_comp_data(u64 type, u64 arg1, u64 arg2, u64 ip) > +static void notrace write_comp_data(u64 type, u64 arg1, u64 arg2, u64 ip) > { > struct task_struct *t; > u64 *area;