Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp104372imj; Wed, 13 Feb 2019 05:28:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IZyT2FFS7WzgfyPI4rQ54XHMyskVriT6VPKMWuyypZJHQ2xVIQ6M/glYbqcbxbR6cLjGtnh X-Received: by 2002:a62:1049:: with SMTP id y70mr532966pfi.220.1550064520061; Wed, 13 Feb 2019 05:28:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550064520; cv=none; d=google.com; s=arc-20160816; b=rPaI2H6wDZcbAjYzVDL6A0GbUyrtVqXknoZvyeMgp09PaFEHS1K5VnMBl5LhuHKVfE sIzN+yspplyePmrHFVu9dXFao1b5LZDVvaukI+u+VxlR/yQ+PmYQDh7BwHYIiftPM020 YB/RlmNlNvK/rUuKqNAygqLy5OZzdjxZsaWvQZyDAPkHQ9YDc0WAwUc8l6KautoeMFLh ykd9IwnsmpQAg2r26FHIEFZFWvnDI1VmbIoire9W26rEZhxhe4a/947qwjN6IYwq0XVD 5oyrj/uEifkmTxdZdlMtGu3Ebm4HZRDClOLWIL2RTv8pHvaEe/Hc74UWbu+QXLFXTCQl wgww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=W7VoyzhgY8Fil6Auuw1B1IwEUMIhd/20KGLJfAr1UXQ=; b=Gsznc2gxq0kKeeN/7cNi0uNNijnIUTFRBMlFEISOnVXEW//PPJ0NzR9wgGQR6ZkIwQ J0W0T11HUYFaikzmhhFKUvl4KOgyi6j4XjU+SFSbWmIF/MR7C6XtAAbaxFWY1EvzhVcd QSCnemze0b3XTp3vaodKEu6JxPpW0eV0p3ryTaUPhk1MwawSRc1Z5ZssElVc/v2zBj/j D+V+QbC8KEd7gXbdrE0MozXY2TQ7oxCqnTRuL5gkAFxjWKcZPonJmgcTbSO5k1hSaaEB q9MU02f92pIo5AK7f4C0DBeVxuh/ulLKCt7Gk+MRQlgHB7lXfwdmL5+djaKA4Typ7KzX GPQQ== 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 x32si15010534pgk.309.2019.02.13.05.28.14; Wed, 13 Feb 2019 05:28:40 -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 S2391170AbfBMJDV (ORCPT + 99 others); Wed, 13 Feb 2019 04:03:21 -0500 Received: from terminus.zytor.com ([198.137.202.136]:48371 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbfBMJDU (ORCPT ); Wed, 13 Feb 2019 04:03:20 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x1D92d25196272 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 13 Feb 2019 01:02:39 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x1D92dU0196268; Wed, 13 Feb 2019 01:02:39 -0800 Date: Wed, 13 Feb 2019 01:02:39 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Masami Hiramatsu Message-ID: Cc: mingo@kernel.org, righi.andrea@gmail.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, mhiramat@kernel.org, tglx@linutronix.de, alexander.shishkin@linux.intel.com, mathieu.desnoyers@efficios.com, acme@redhat.com, peterz@infradead.org, rostedt@goodmis.org, hpa@zytor.com, jolsa@redhat.com Reply-To: jolsa@redhat.com, hpa@zytor.com, peterz@infradead.org, rostedt@goodmis.org, acme@redhat.com, alexander.shishkin@linux.intel.com, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mhiramat@kernel.org, mingo@kernel.org, righi.andrea@gmail.com, torvalds@linux-foundation.org In-Reply-To: <154998804911.31052.3541963527929117920.stgit@devbox> References: <154998804911.31052.3541963527929117920.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] kprobes: Prohibit probing on preemption checking debug functions Git-Commit-ID: 984640ce427fa67c7c1f8550ab53495733bd11fc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 984640ce427fa67c7c1f8550ab53495733bd11fc Gitweb: https://git.kernel.org/tip/984640ce427fa67c7c1f8550ab53495733bd11fc Author: Masami Hiramatsu AuthorDate: Wed, 13 Feb 2019 01:14:09 +0900 Committer: Ingo Molnar CommitDate: Wed, 13 Feb 2019 08:16:40 +0100 kprobes: Prohibit probing on preemption checking debug functions Since kprobes depends on preempt disable/enable, probing on the preempt debug routines can cause recursive breakpoint bugs. Signed-off-by: Masami Hiramatsu Cc: Alexander Shishkin Cc: Andrea Righi Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/154998804911.31052.3541963527929117920.stgit@devbox Signed-off-by: Ingo Molnar --- lib/smp_processor_id.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c index 85925aaa4fff..157d9e31f6c2 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c @@ -5,10 +5,11 @@ * DEBUG_PREEMPT variant of smp_processor_id(). */ #include +#include #include -notrace static unsigned int check_preemption_disabled(const char *what1, - const char *what2) +notrace static nokprobe_inline +unsigned int check_preemption_disabled(const char *what1, const char *what2) { int this_cpu = raw_smp_processor_id(); @@ -56,9 +57,11 @@ notrace unsigned int debug_smp_processor_id(void) return check_preemption_disabled("smp_processor_id", ""); } EXPORT_SYMBOL(debug_smp_processor_id); +NOKPROBE_SYMBOL(debug_smp_processor_id); notrace void __this_cpu_preempt_check(const char *op) { check_preemption_disabled("__this_cpu_", op); } EXPORT_SYMBOL(__this_cpu_preempt_check); +NOKPROBE_SYMBOL(__this_cpu_preempt_check);