Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11880068imu; Tue, 1 Jan 2019 08:48:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ORAyn5nPknZsuPTdE/QGF5uKNztiVSb2788OBpIro4WX2LQOEMFzD4p/g9NaL66Kl3GGc X-Received: by 2002:a17:902:7581:: with SMTP id j1mr40994966pll.308.1546361318822; Tue, 01 Jan 2019 08:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546361318; cv=none; d=google.com; s=arc-20160816; b=DhTp89t2h4/ebnCbYFmBWLcXgC/j7I3eSU6qfF/5EkzGm761eOYfauy/JoyMYEEis5 0+VygXgp2XF4n57ZFnEIA58utfPcY7x4m+XAAURoqVTIkfqFenxRWK080G8YYUlkm4OP LheTXsnzPqvSdR6d9d/gL4kxMptApj9vX/ur3lbDnbAWvJ44F+fmb28YQz2A7xcM1nnZ D4EwvSlB5pU1I9WH2p74OsFH7DZuSCcX9w55cNc8uOxbfTh7Nv4dzozwBMDMP8OpgRup 9NVU3ClTAz4edS6fT9qMtyn/0kfWOWJfuokQFMDVZQDU9mc87S1O7+QrDGPalw+XRlca CLsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BjUVU2ybTR2Rlq9XWQP5P5Fy5OxBSiBv/vBqRVVSl3I=; b=c0FmU7Db7P03zMrPemKe0JAwHERWTdDnQ5/mYcCU5p4/jRYK5CQIvRW+GrGUBvcj1m AXBm/BCzhjIX0nvvQon2Um95bZQ6CFcZl8NEK/e0Qfh4xv8zey5WbRK7gQBvkq9ETs3z 3PZfuNRtqBvqrsgHTVH5p2Bfg8IeKr4UB1gGa/mqXoVPmyh8zigQoVY+7J4CJINg1UtO Ax+UoxsVE7+W2y1Eglr9Zk6EgP2iDEx1RbNLECRDjsMyqgXyOxO1uHjKDgTRCwgSCM+R H5SuCPQG4BgpqNuUcOazKIB5cQQwA9Yt2QEV93jH1b+WiW/4V7MDAMv3XkgxiDxd9aBt T3iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r4YV/DlX"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si5091793pgo.11.2019.01.01.08.48.20; Tue, 01 Jan 2019 08:48:38 -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=@gmail.com header.s=20161025 header.b="r4YV/DlX"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728812AbfAANhV (ORCPT + 99 others); Tue, 1 Jan 2019 08:37:21 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37480 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728493AbfAANhV (ORCPT ); Tue, 1 Jan 2019 08:37:21 -0500 Received: by mail-wm1-f65.google.com with SMTP id g67so25751049wmd.2 for ; Tue, 01 Jan 2019 05:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BjUVU2ybTR2Rlq9XWQP5P5Fy5OxBSiBv/vBqRVVSl3I=; b=r4YV/DlXuN5dNGpX9jyYSFH9HiqJQTA8W17YZx4xI5wJDdROtoLd29q5++LKdJUjMR YC7+vvc2WkCcKrddU1V0m0uqSNAeRI98lIqrOdc9JpLn6aGicpC8OJTm25PYgR12QhbJ Sn2PqNgi/Oc+ewMHcwXXPybHbggbXbKIkk+lnKbHJul9r0gTsq9RMo0sbtCp8/tolYuH IH/c5XTwK2uHlzamYBB12NJNwyx/6/mTsaQkie3ZaJVM27gs94Em/QFSklCjjbumd9Fu pSp8hE0GVvL2xfLz4brrzedvJwXxUM87ss67gNWrICMGFAcLfYzXJ6X6C613YDCkPkaw ADbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BjUVU2ybTR2Rlq9XWQP5P5Fy5OxBSiBv/vBqRVVSl3I=; b=AFkDNsEq7skoWoVOQ068iz97IFG81VslrdryF9+vyz5U0PkTx7X0aAgpMe5rrfqA9a Ri6rAhT6axeN87ffAXw8u7s6tJLxOs+PrzpwDrf6s8//dE8lHekdj75AB429efg/jgdj 9Sdkl3R6msiFUKMAcIgCpkrgpdhjJJnebydyVYT770re84ueNi4nZxf+Z+QvEawU/f2n zb7iAiI+3U4bjCKVk0kwO1CahSsJOxjIadP52+iV3srJpEIk7Z79mDCz1JVOwauKQucJ JbxPpP+ASJICXDsrfx+orCVCg5+Ee4cHcKXwEgD7vgssjHfOaf28Yly65DPQ8FnLN5EC qotw== X-Gm-Message-State: AA+aEWYiYpvjLG/UiIevyiR3WA8uBaM8Hx2e4ntdyDzLDRw43C0Ity5H ekdugTOEJDHzbL2x2D9SCw== X-Received: by 2002:a1c:3d44:: with SMTP id k65mr32331791wma.76.1546349838701; Tue, 01 Jan 2019 05:37:18 -0800 (PST) Received: from localhost (host254-25-dynamic.53-79-r.retail.telecomitalia.it. [79.53.25.254]) by smtp.gmail.com with ESMTPSA id a12sm42442754wro.18.2019.01.01.05.37.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Jan 2019 05:37:17 -0800 (PST) Date: Tue, 1 Jan 2019 14:37:16 +0100 From: Andrea Righi To: Masami Hiramatsu Cc: Ingo Molnar , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" , Yonghong Song , Andy Lutomirski , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs Message-ID: <20190101133716.GA1811@xps-13> References: <154503482486.26176.6224515860220847638.stgit@devbox> <20181217154713.GA1308@Dell> <20181218135026.6f96a89247e9b70fa45afbe9@kernel.org> <20181218172134.GA2902@xps-13> <20181227170934.GA2057@xps-13> <20190101221654.fedda794776540d6b81f6167@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190101221654.fedda794776540d6b81f6167@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 01, 2019 at 10:16:54PM +0900, Masami Hiramatsu wrote: ... > > > > > Do you see a nice and clean way to blacklist all these functions > > > > > (something like arch_populate_kprobe_blacklist()), or should we just > > > > > flag all of them explicitly with NOKPROBE_SYMBOL()? > > > > > > > > As I pointed, you can probe it via your own kprobe module. Like systemtap, > > > > you still can probe it. The blacklist is for "kprobes", not for "kprobe_events". > > > > (Those are used to same, but since the above commit, those are different now) > > > > > > > > I think the most sane solution is, identifying which (combination of) functions > > > > in ftrace (kernel/trace/*) causes a problem, marking those NOKPROBE_SYMBOL() and > > > > removing CONFIG_KPROBE_EVENTS_ON_NOTRACE. > > > > I'm planning to spend a little bit more time on this and see if I can > > identify the problematic ftrace functions and eventually drop > > CONFIG_KPROBE_EVENTS_ON_NOTRACE, following the sane solution. > > > > However, in the meantime, with the following patch I've been able to get > > a more reliable kprobes blacklist and show also the notrace functions in > > debugfs when CONFIG_KPROBE_EVENTS_ON_NOTRACE is off. > > Hmm, if CONFIG_KPROBE_EVENTS_ON_NOTRACE=n, we already have a whitelist of > functions in /sys/kernel/debug/tracing/available_filter_functions, > so I don't think we need a blacklist. OK. > > > It's probably ugly and inefficient, because it's iterating over all > > symbols in x86's arch_populate_kprobe_blacklist(), but it seems to work > > for my specific use case, so I thought it shouldn't be bad to share it, > > just in case (maybe someone else is also interested). > > Hmm, but in that case, it limits other native kprobes users like systemtap > to disable probing on notrace functions with no reasons. That may not be acceptable. True... > > OK, I'll retry to find which notrace function combination tracing with > kprobes are problematic. Let me do it... OK. Thanks tons for looking into this! -Andrea