lkml.org 
[lkml]   [2006]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] Kprobes: Make kprobe modules more portable
On Wed, Aug 09, 2006 at 05:10:39PM +0100, Christoph Hellwig wrote:
> On Wed, Aug 09, 2006 at 11:01:45AM -0500, David Smith wrote:
> > > + if (p->symbol_name) {
> > > + if (p->addr)
> > > + return -EINVAL;
> > > + p->addr = kprobe_lookup_name(p->symbol_name) + p->offset;
> > > + }
> >
> > What if kprobe_lookup_name() fails
>
> for that case we need the check in your snipplet below.

The next check:

if ((!kernel_text_address((unsigned long) p->addr)) ||
in_kprobes_functions((unsigned long) p->addr))
return -EINVAL;

will catch this case anyway (unless some arch has kernel text starting
at vaddr 0)

Ananth

>
> > or if CONFIG_KALLSYMS isn't set?
>
> I think we should just disallow that case. having kprobes without kallsyms
> is rather pointless. I'll send a patch to add the dependency to the Kconfig
> files.
>
> > Perhaps this needs something like:
> >
> > if (p->symbol_name) {
> > if (p->addr)
> > return -EINVAL;
> > p->addr = kprobe_lookup_name(p->symbol_name) + p->offset;
> > if (p->addr == p->offset)
> > return -EINVAL;
> > }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-10 08:21    [W:0.067 / U:10.956 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site