Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2659747imj; Mon, 11 Feb 2019 06:36:55 -0800 (PST) X-Google-Smtp-Source: AHgI3Iac+p9/UsQk9gqZmhPGIm7Lq0B0eAJLFFOGpgGHzcyUcOqqMasyMe5mCq5IzEtL9WdyfuMz X-Received: by 2002:a63:da0e:: with SMTP id c14mr9727855pgh.247.1549895815713; Mon, 11 Feb 2019 06:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895815; cv=none; d=google.com; s=arc-20160816; b=XjBNYJcYaBObJqZqoGhWsnR2Edr74uRbxnO/aRr9vWtY4rbcoVPhIeSIO/W4+c/22K /TG6WPA8YPjlHc1JnXG2n0KHWAKjRemmEocDYldIHG/wq8M7oJKfceXA4iv5o01VAkBw 4vZXkktdWMfZOJs9b3NpbZQiecHrVf85WVT+bE8494cYQWSANZM8TRB18L6rea6bJOaT oV7ZuYTRAZ05eLjX8Ssv0oZbVlisjbHu2TTKq980Yrt/dEEHQO0pVDSxpFeCNXS+oQld TP6IMlbT9vziPNndz0GmOMAFv00flCtoe5y2Eqh1fB7TeVBkIhW/01PD+IWhOS7PZfAt Mdyg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZR+iTWGfA5NxYNLU/w3cKWmaqwKtLJu7AFuL+xWXb7I=; b=gwt4F/Wo052dUgg/a8ET8T1dgHDaItyOrIz4q4Pl+AERiLs7ljErpYvJl2v8NouHoL jlPO4JMCggvJ3eNt/EsAfEMUZci6NPr3wMoSMhOgnDrZ/KcNSmGYiTrMovTYvJsPw/Q6 ZdPf4z+8aXLl3aJAQnHCAKMZx7rwRxV3vNoePA8uXo6nwHy2FoV6ZgPMFU672zt9A8d2 26j+k4ztficoYs62p7dAmf1V2cUzEFw+FevjDtsJrTb5Pg3q0/lzMSc/0cKdhlV1a6dQ RFa0lRFmGu7h4MWccf6ICJqhxy+oBME5qIcN1FX/9uA8hUcxzmbJAGiESGbSf6jCh5Gk 2GEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KmrifAzK; 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 g8si10443003pgo.166.2019.02.11.06.36.39; Mon, 11 Feb 2019 06:36:55 -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=@kernel.org header.s=default header.b=KmrifAzK; 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 S1730908AbfBKOeq (ORCPT + 99 others); Mon, 11 Feb 2019 09:34:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:43132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730886AbfBKOeo (ORCPT ); Mon, 11 Feb 2019 09:34:44 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 BA88F204EC; Mon, 11 Feb 2019 14:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895683; bh=W5aHUB5JG86hnPsgC5USulLR+hcfb8pTzTgcmcDoHJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KmrifAzKx4LyBsgcclduClClUUmP3GfRZ78+CirCs3l+GsbWHi3Hsv49IvGLXJs/h sqXKpPj7XinOpM9vgq9HTI8etE2IGKPamtVXsg19ySuiwmH/xz2JozcJYpE93nLJYT iqFzwLUej90qkzeugQDinyESdERW2nxRVtgyZSFU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Arnd Bergmann , "Steven Rostedt (VMware)" , Will Deacon , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.20 288/352] kernel/kcov.c: mark write_comp_data() as notrace Date: Mon, 11 Feb 2019 15:18:35 +0100 Message-Id: <20190211141905.245111090@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 634724431607f6f46c495dfef801a1c8b44a96d9 ] 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. Link: http://lkml.kernel.org/r/20181206143011.23719-1-anders.roxell@linaro.org Signed-off-by: Anders Roxell Signed-off-by: Arnd Bergmann Co-developed-by: Arnd Bergmann Acked-by: Steven Rostedt (VMware) Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- 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; -- 2.19.1