Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp104744imj; Wed, 13 Feb 2019 05:29:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IYSwqkwlAsxWRvZyhTa5/PV411xX2ls2k7s2V3pVzkO082Fcz17klDp5/K8txfpUfyk3TXv X-Received: by 2002:a63:1d1d:: with SMTP id d29mr489253pgd.49.1550064542187; Wed, 13 Feb 2019 05:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550064542; cv=none; d=google.com; s=arc-20160816; b=QdAgUBmhWP8hfOQRyJGsfp2/ZYlgBs1qqbigtvkRiMIkD01YBL6IFn0Nsx7/wJP5m+ Q+P4lzQM1HKgg1tvqd6mAoMx98mXQmJB5fCFojeE23MXh9JmaXa3jkrbHas1kh74LNPv qi92sQVedXUn0nuVrOHasbkqKl3cBTsj/jLErjhrmLyDBmS8NVRlMMJMbdXP4S7kxz1a YpeMTCR4UOk/M43Nv39aFAs62DJCgXVMMuZJvJjXRpdNvD6rAGv/DyCUlPWJwcj3BUv6 glu98/3S0A1c7C4ZScN8SzLVUTEP+Ld9lnnII29guUFMxrHkfANG1f6dBlcy1ZCI5DJn OjbQ== 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=EBZpivJ8tJybjXJQABt3PMKgHEb9cd8vADV7MsRjanY=; b=QApCxCqCrCjJkxPTuLc7F3MRs/x3htRbE0FArSNGoTM3RJGfl7opxPGRd3Fw8cuY7W Xoo6Xsv1waZvmh4rg/BUs85+L5jekQrZsZ6fauKKfw90PWSp7q/9ZcvE1okSsKuQgq2s gbLIgJ25Z08LyPXS0lvqL6hRwBi3jIjHw/eQTfGNkUgfqNo6uTSehInYJbSdhGJrZ8Nd ozecjMRiVa6n9StMAjbESwnWYbc7Kp5Ci+269v9TgQVIUbUZBdhtf0ETBhabSOelCDzj euFaMY1b0ZzklLiSBSoA295LDIqmwSpMIhDpidhOdhWEkgWu0u0wpBjW1p7CPIhCB0oe 7Nnw== 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 g187si15653405pfc.43.2019.02.13.05.28.35; Wed, 13 Feb 2019 05:29:02 -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 S2391202AbfBMJEc (ORCPT + 99 others); Wed, 13 Feb 2019 04:04:32 -0500 Received: from terminus.zytor.com ([198.137.202.136]:60321 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389478AbfBMJEb (ORCPT ); Wed, 13 Feb 2019 04:04:31 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x1D93rAX196582 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 13 Feb 2019 01:03:53 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x1D93r54196579; Wed, 13 Feb 2019 01:03:53 -0800 Date: Wed, 13 Feb 2019 01:03:53 -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: hpa@zytor.com, rostedt@goodmis.org, alexander.shishkin@linux.intel.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, mathieu.desnoyers@efficios.com, righi.andrea@gmail.com, jolsa@redhat.com, peterz@infradead.org, torvalds@linux-foundation.org, mhiramat@kernel.org Reply-To: hpa@zytor.com, rostedt@goodmis.org, acme@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, mathieu.desnoyers@efficios.com, righi.andrea@gmail.com, jolsa@redhat.com, peterz@infradead.org, mhiramat@kernel.org, torvalds@linux-foundation.org In-Reply-To: <154998810578.31052.1680977921449292812.stgit@devbox> References: <154998810578.31052.1680977921449292812.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] kprobes: Prohibit probing on lockdep functions Git-Commit-ID: 2f43c6022d84b2f562623a7023f49f1431e50747 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: 2f43c6022d84b2f562623a7023f49f1431e50747 Gitweb: https://git.kernel.org/tip/2f43c6022d84b2f562623a7023f49f1431e50747 Author: Masami Hiramatsu AuthorDate: Wed, 13 Feb 2019 01:15:05 +0900 Committer: Ingo Molnar CommitDate: Wed, 13 Feb 2019 08:16:41 +0100 kprobes: Prohibit probing on lockdep functions Some lockdep functions can be involved in breakpoint handling and probing on those functions can cause a breakpoint recursion. Prohibit probing on those functions by blacklist. 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/154998810578.31052.1680977921449292812.stgit@devbox Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 95932333a48b..bc35a54ae3d4 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -2814,6 +2815,7 @@ void lockdep_hardirqs_on(unsigned long ip) __trace_hardirqs_on_caller(ip); current->lockdep_recursion = 0; } +NOKPROBE_SYMBOL(lockdep_hardirqs_on); /* * Hardirqs were disabled: @@ -2843,6 +2845,7 @@ void lockdep_hardirqs_off(unsigned long ip) } else debug_atomic_inc(redundant_hardirqs_off); } +NOKPROBE_SYMBOL(lockdep_hardirqs_off); /* * Softirqs will be enabled: @@ -3650,7 +3653,8 @@ __lock_release(struct lockdep_map *lock, int nested, unsigned long ip) return 0; } -static int __lock_is_held(const struct lockdep_map *lock, int read) +static nokprobe_inline +int __lock_is_held(const struct lockdep_map *lock, int read) { struct task_struct *curr = current; int i; @@ -3883,6 +3887,7 @@ int lock_is_held_type(const struct lockdep_map *lock, int read) return ret; } EXPORT_SYMBOL_GPL(lock_is_held_type); +NOKPROBE_SYMBOL(lock_is_held_type); struct pin_cookie lock_pin_lock(struct lockdep_map *lock) {