From: wcohen@redhat.com (William Cohen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: Blacklist non-kprobe-able symbols
Date: Mon, 6 Jul 2015 10:42:03 -0400 [thread overview]
Message-ID: <559A93BB.7090007@redhat.com> (raw)
In-Reply-To: <559A688D.1040501@hitachi.com>
On 07/06/2015 07:37 AM, Masami Hiramatsu wrote:
> On 2015/07/06 18:03, Will Deacon wrote:
>> On Mon, Jul 06, 2015 at 06:03:21AM +0100, Pratyush Anand wrote:
>>> Add all function symbols which are called from do_debug_exception under
>>> NOKPROBE_SYMBOL, as they can not kprobed.
>>
>> It's a shame this has to be so manual, but I suppose it's done on a
>> best-effort basis to catch broken probe placement.
>
> Ah, yes. You can use kprobe-tracer in ftrace by feeding all symbols to
> them and enabling it (and pray).
Yes, this approach isn't guaranteed to find problem functions. There could be problems hidden on conditional paths that are rarely called. This was observed with the aarch64 kretprobe trampoline handler. Most times it wouldn't call kfree and everything would run fine. However, sometimes the kfree which was instrumented for a systemtap test would get called from inside the trampoline handler and trigger a recursive exception. This is why aarch64 tramopline was rewritten avoid using kprobe.
Is there some tool that can generate a static call graph of the kernel? Maybe use the output of that to get more complete list of which functions should be off limits for kprobes. One complication is that some tools might not analyze functions written in assembly and miss some possible function calls.
-Will Cohen
>
>
>> If we miss a function and somebody probes it, do we just get stuck in a
>> recursive exception, or could we print something suggesting that a symbol
>> be annotated as NOKPROBE?
>
> For some cases we can detect recursion, but usually, it may reset
> itself or infinite recursion loop before detecting it. :(
>
> Thank you,
>
next prev parent reply other threads:[~2015-07-06 14:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 5:03 [PATCH 0/2] arm64: some symbols blacklisted for kprobing Pratyush Anand
2015-07-06 5:03 ` [PATCH 1/2] arm64: Blacklist non-kprobe-able symbols Pratyush Anand
2015-07-06 9:03 ` Will Deacon
2015-07-06 10:48 ` Pratyush Anand
2015-07-06 11:56 ` Masami Hiramatsu
2015-07-06 11:37 ` Masami Hiramatsu
2015-07-06 14:42 ` William Cohen [this message]
2015-07-06 11:11 ` Masami Hiramatsu
2015-07-06 11:49 ` Pratyush Anand
2015-07-09 13:53 ` Pratyush Anand
2015-07-06 5:03 ` [PATCH 2/2] arm64: Make all entry code as non-kprobe-able Pratyush Anand
2015-07-06 11:03 ` Masami Hiramatsu
2015-07-06 11:54 ` Pratyush Anand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559A93BB.7090007@redhat.com \
--to=wcohen@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).