Re: Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Masami Hiramatsu
(2014/04/15 18:16), Jianyu Zhan wrote: > Ok, I've followed your suggestion. Thanks :-) > > Currently, if user specifies both symbol name and address, we just > bail out. > > This might be too rude. This patch makes it give more tolerance. > If both are specified, check address first, if the symbo

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Jianyu Zhan
Ok, I've followed your suggestion. Thanks :-) Currently, if user specifies both symbol name and address, we just bail out. This might be too rude. This patch makes it give more tolerance. If both are specified, check address first, if the symbol found does not match the one user specify, print a

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Masami Hiramatsu
Sorry for resending... (2014/04/15 17:10), Jianyu Zhan wrote: > Currently, if user specifies both symbol name and address, we just > bail out. > > This might be too rude. This patch makes it give more tolerance. > If both are specified, check address first, if the symbol found > does not match th

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Masami Hiramatsu
(2014/04/15 17:10), Jianyu Zhan wrote: > Currently, if user specifies both symbol name and address, we just > bail out. > > This might be too rude. This patch makes it give more tolerance. > If both are specified, check address first, if the symbol found > does not match the one user specify, prin

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Zhan Jianyu
On Tue, Apr 15, 2014 at 4:27 PM, Masami Hiramatsu wrote: > > Plus, if the p->offset and offs are different, fail too. Oh, yeah, I have did this check it patch too. BTW, I found that the offset has different types in kallsyms_lookup(which is unsigned long) and in struct kprobe(which is unsigne

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Masami Hiramatsu
(2014/04/15 17:11), Zhan Jianyu wrote: > On Mon, Apr 14, 2014 at 11:00 PM, Masami Hiramatsu > 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! ..."); >>

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Zhan Jianyu
On Mon, Apr 14, 2014 at 11:00 PM, Masami Hiramatsu 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->symbo

[PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-15 Thread Jianyu Zhan
Currently, if user specifies both symbol name and address, we just bail out. This might be too rude. This patch makes it give more tolerance. If both are specified, check address first, if the symbol found does not match the one user specify, print a waring. If not found, return -ENOENT, because s

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-14 Thread Masami Hiramatsu
(2014/04/14 19:40), Jianyu Zhan wrote: > Currently, if user specifies both symbol name and address, we just > bail out. > > This might be too rude. This patch makes it give more tolerance. > If both are specified, let symbol name take precedence; upon failure, > try address. And print a warning me

Re: [PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-14 Thread Masami Hiramatsu
(2014/04/14 19:40), Jianyu Zhan wrote: > Currently, if user specifies both symbol name and address, we just > bail out. > > This might be too rude. This patch makes it give more tolerance. > If both are specified, let symbol name take precedence; upon failure, > try address. And print a warning me

[PATCH] kprobes: be more permissive when user specifies both symbol name and address

2014-04-14 Thread Jianyu Zhan
Currently, if user specifies both symbol name and address, we just bail out. This might be too rude. This patch makes it give more tolerance. If both are specified, let symbol name take precedence; upon failure, try address. And print a warning message if user specify an address to inform him that