From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Zhan Jianyu <nasa4836@gmail.com>
Cc: ananth@in.ibm.com, anil.s.keshavamurthy@intel.com,
davem@davemloft.net, rdunlap@infradead.org,
linux-doc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
"yrl.pp-manager.tt@hitachi.com" <yrl.pp-manager.tt@hitachi.com>
Subject: Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address
Date: Tue, 15 Apr 2014 17:27:07 +0900 [thread overview]
Message-ID: <534CED5B.2090100@hitachi.com> (raw)
In-Reply-To: <CAHz2CGV_WA_bMwYCg1QCyFpCv0PKgPhBQUf_pFQbNn-guLL+Ag@mail.gmail.com>
(2014/04/15 17:11), Zhan Jianyu wrote:
> On Mon, Apr 14, 2014 at 11:00 PM, Masami Hiramatsu
> <masami.hiramatsu.pt@hitachi.com> wrote:
>> if (p->addr) {
>> if (p->symbol) {
>> sym = kallsyms_lookup(p->addr, ... &offs ...);
>> if (strcmp(sym,p->symbol) != 0 || offs != p->offset) {
>> pr_warning("Error! ...");
>> goto fail;
>> }
>> }
>> } else if (p->symbol) {
>> kprobe_lookup_name(p->symbol_name, addr);
>> if (!addr)
>> goto fail;
>> } else
>> goto fail;
>
>
> Hmm, let's clasify all conditions.
>
> 1. Only symbol, check it, if not found, fail.
> 2. Only address, check it, if not found, fail.
> 3. Both, check address,
> 3.1 not found, fail, because some symbols might have muplitple instances,
> we don't bother to check symbol name.
> 3.2 found, check if symbol mismatch, if yes, fail.
Plus, if the p->offset and offs are different, fail too.
> Is this reasonable? Next mail is a renewed patch following this priciple.
OK, let me see. :)
Thank you,
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2014-04-15 8:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 10:40 [PATCH] kprobes: be more permissive when user specifies both symbol name and address Jianyu Zhan
2014-04-14 15:00 ` Masami Hiramatsu
2014-04-15 8:11 ` Zhan Jianyu
2014-04-15 8:27 ` Masami Hiramatsu [this message]
2014-04-15 8:33 ` Zhan Jianyu
2014-04-14 15:08 ` Masami Hiramatsu
-- strict thread matches above, loose matches on Subject: below --
2014-04-15 8:10 Jianyu Zhan
2014-04-15 8:54 ` Masami Hiramatsu
2014-04-15 8:58 ` Masami Hiramatsu
2014-04-15 9:16 Jianyu Zhan
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=534CED5B.2090100@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=davem@davemloft.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nasa4836@gmail.com \
--cc=rdunlap@infradead.org \
--cc=yrl.pp-manager.tt@hitachi.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