From: Steven Rostedt <rostedt@goodmis.org>
To: Kenny Yu <kennyyu@fb.com>
Cc: <mingo@redhat.com>, <osandov@fb.com>,
<linux-kernel@vger.kernel.org>, <kernel-team@fb.com>
Subject: Re: [PATCH] uprobe: Find last occurrence of ':' when parsing uprobe PATH:OFFSET
Date: Fri, 13 Jan 2017 12:14:17 -0500 [thread overview]
Message-ID: <20170113121417.26dcc3de@gandalf.local.home> (raw)
In-Reply-To: <20170113165834.4081016-1-kennyyu@fb.com>
On Fri, 13 Jan 2017 08:58:34 -0800
Kenny Yu <kennyyu@fb.com> wrote:
> Previously, `create_trace_uprobe` found the *first* occurence
> of the ':' character when parsing `PATH:OFFSET` for a uprobe.
> However, if the path contains a ':' character, then the function
> would parse the path incorrectly. Even worse, if the path does not
> exist, the subsequent call to `kern_path()` would set `ret` to
> `ENOENT`, leading to very cryptic errno values in user space.
>
> The fix is to find the *last* occurence of ':'.
>
> How to repro:: The write fails with "No such file or directory", suggesting
> incorrectly that the `uprobe_events` file does not exist.
>
> $ mkdir testing && cd testing
> $ cp /bin/bash .
> $ cp /bin/bash ./bash:with:colon
> $ echo "p:uprobes/p__root_testing_bash_0x6 /root/testing/bash:0x6" > /sys/kernel/debug/tracing/uprobe_events # this works
> $ echo "p:uprobes/p__root_testing_bash_with_colon_0x6 /root/testing/bash:with:colon:0x6" >> /sys/kernel/debug/tracing/uprobe_events # this doesn't
> -bash: echo: write error: No such file or directory
>
> With the patch:
>
> $ echo "p:uprobes/p__root_testing_bash_0x6 /root/testing/bash:0x6" > /sys/kernel/debug/tracing/uprobe_events # this still works
> $ echo "p:uprobes/p__root_testing_bash_with_colon_0x6 /root/testing/bash:with:colon:0x6" >> /sys/kernel/debug/tracing/uprobe_events # this works now too!
> $ cat /sys/kernel/debug/tracing/uprobe_events
> p:uprobes/p__root_testing_bash_0x6 /root/testing/bash:0x0000000000000006
> p:uprobes/p__root_testing_bash_with_colon_0x6 /root/testing/bash:with:colon:0x0000000000000006
>
Thanks! I'll add this to my queue.
-- Steve
prev parent reply other threads:[~2017-01-13 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 16:58 Kenny Yu
2017-01-13 17:14 ` Steven Rostedt [this message]
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=20170113121417.26dcc3de@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=kennyyu@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=osandov@fb.com \
/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
all inboxes | Powered by JetHome®