Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1243983imu; Fri, 11 Jan 2019 18:32:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN4CTjIvn+F8JYXPP2g3ZO/ybuIiS7Ra3dz9SSlPwc0C5mZkBk7bZGHMCRRgkMEfNsLkzMEc X-Received: by 2002:a63:e247:: with SMTP id y7mr12712170pgj.84.1547260351373; Fri, 11 Jan 2019 18:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547260351; cv=none; d=google.com; s=arc-20160816; b=E4bs/TXTV7r5LxTpTcd3Tpl3UBVDM1BV8H+q/VwQ+hz+AhaMG09aQQUy0SOAqSKOy+ kzKxfY2l7XDQKXP/er4C4zAE2x1CHkCT6wIPb6AhxB1z3nEYcCt59utFBjae0caw/NmB DrJdlI0xoXVxLcDHz3AwPClbT4oPhowkzenOOEKW9PtKCZa/sRvuULlWMg/XeleLMZXH otKi4QAfdfORcHleoYwnZOOO6vm4AGV8OJH1nneO1sSp8Nc8mLYlgbjER00/Bd4isKfn R5MWxinRcnO5u3L0x3LXzDoBnU5u0BISMTTekUsUrafmz/9rihSgF1Tq21lFVZp3lk9y bXtA== 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=z+gnFEzLd4VxLe7zJRduBylQM96s6Wu0M9HRrTBqr78=; b=EY+DPeV3coFqUI46rf0iS4upVr+RpjzR2kEh8QPxIRuHzaZTgtFx2tlSuXq9mc/wr7 mIuM96ESixWUe+zqAxu6pv/MUwdQTMeiY8whiglnMalzFNnqeuYcq4JY1kw5j3OR2J/z VzMmQRb+nZ0LyfWP1aB48tBRLNMb++jrmvmB47owKEu1OAGKAuRqXK/+/JKzLXN0IQAD Wz5wIxy+Sz1zfb+Tz9uWcVGieE7luPuChJ85E43k9CR5Gyw0SCuiUsOk9fLMqZWoYOsc IjQBX2T0ZTmvCa9fOZ/6Kc9rE2arH4vZ/TTkTnm4BHP4f/LmJITyKDO7QIidadqtngkz ThDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xH/55Xss"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si21995378pfa.6.2019.01.11.18.32.16; Fri, 11 Jan 2019 18:32:31 -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="xH/55Xss"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbfALC3X (ORCPT + 99 others); Fri, 11 Jan 2019 21:29:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:48826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfALC3W (ORCPT ); Fri, 11 Jan 2019 21:29:22 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 DEE2D204FD; Sat, 12 Jan 2019 02:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547260162; bh=VND5k2JW7QtV9ySj2wCYQ+iFgA8ygUhr6ofMEiu+/Dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xH/55XssX8Ybo4OGJjYdH9wtOFR92YytHdiY/sHH5DQrQQ+D+QW4eMfUSE8W/HS71 QvEVJYb5pFiIAxfYiV9ZABbtkQbq72kEaa46uPoVop+13DlVKmdjg3GuHOEUUA5xgT MED+Xu0w0sqhOEG+CV6MjPjpVVP19J3ZMytQGHjE= From: Masami Hiramatsu To: Ingo Molnar Cc: Masami Hiramatsu , peterz@infradead.org, Mathieu Desnoyers , linux-kernel , Andrea Righi , Steven Rostedt Subject: [PATCH v2 7/9] kprobes: Prohibit probing on preempt_check debug functions Date: Sat, 12 Jan 2019 11:28:59 +0900 Message-Id: <154726013890.18060.11204538289611057483.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <154725993986.18060.2759150647140353514.stgit@devbox> References: <154725993986.18060.2759150647140353514.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since kprobes depends on preempt disable/enable, probing on the preempt debug routine can cause recursive breakpoint problem. Signed-off-by: Masami Hiramatsu --- 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);