Re: [PATCH -tip v2 3/3] [BUGFIX] kprobes: Prohibit probing onfunc_ptr_is_kernel_text

From: Ingo Molnar
Date: Wed Nov 06 2013 - 06:50:15 EST



* Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx> wrote:

> (2013/11/06 15:07), Ingo Molnar wrote:
> >
> > * Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx> wrote:
> >
> >>>> [...] I hope to build the list when the kernel build time if
> >>>> possible... Would you have any idea to classify some annotated(but no
> >>>> side-effect) functions?
> >>>
> >>> The macro magic I can think of would need to change the syntax of the
> >>> function definition - for example that is how the SYSCALL_DEFINE*()
> >>> macros work.
> >>
> >> Would you mean something like the below macro? :)
> >>
> >> NOKPROBE_SYMBOL(int, func_ptr_is_kernel_text)(void *ptr)
> >
> > I think this is rather ugly and harder to maintain. The whole _point_ of
> > such annotations is to make them 'easy on the eyes', to make it easy to
> > skip a 'noinline', 'noprobe' or 'notrace' tag.
> >
> > Using something like NOKPROBE_SYMBOL() makes the whole construct ugly and
> > attention seeking.
>
> Hmm, by the way how about Steven's idea? A macro like EXPORT_SYMBOL? At
> least for kprobes_blacklist, which is defined/maintained in kprobes.c
> for some symbols(*), that is useful for updating it because we can put
> it near the function definition.

Dunno, it feels a bit fragile to me.

Thanks,

Ingo
--
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/