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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 14, 2014 at 11:00 PM, Masami Hiramatsu
<masami.hiramatsu.pt@xxxxxxxxxxx> 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.


Is this reasonable?  Next mail is a renewed patch following this priciple.


Regards,
Jianyu Zhan
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux