Re: [1/6 PATCH] Kprobes : Prevent possible race conditions generic changes

From: Andi Kleen
Date: Thu Jul 07 2005 - 05:41:25 EST


On Thu, Jul 07, 2005 at 03:25:37AM -0700, Andrew Morton wrote:
> Prasanna S Panchamukhi <prasanna@xxxxxxxxxx> wrote:
> >
> > There are possible race conditions if probes are placed on routines within the
> > kprobes files and routines used by the kprobes.
>
> So... don't do that then? Is it likely that anyone would want to stick a
> probe on the kprobe code itself?

iirc one goal of systemtap (which uses kprobes) is to be provable
safe so that an user cannot crash the kernel by adding probes. Basically
to make it possible to use this on production systems safely. I have my
doubts they will fully reach it, but at least it's a nice goal.

> > -int register_kprobe(struct kprobe *p)
> > +static int __kprobes in_kprobes_functions(unsigned long addr)
> > +{
> > + /* Linker adds these: start and end of __kprobes functions */
> > + extern char __kprobes_text_start[], __kprobes_text_end[];
>
> There's an old unix convention that section markers (start, end, edata,
> etc) are declared `int'. For some reason we don't do that in the kernel.
> Oh well.

The Linux convention is to put it into asm-generic/sections.h at least.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/