Re: [TRIVIAL PATCH 2/2] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL

From: Masami Hiramatsu
Date: Thu Mar 09 2017 - 02:56:59 EST


On Wed, 8 Mar 2017 22:34:15 +0530
"Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxxxxxxx> wrote:

> commit fc62d0207ae0 ("kprobes: Introduce weak variant of
> kprobe_exceptions_notify()") used the __kprobes annotation to exclude
> kprobe_exceptions_notify from being probed. Since NOKPROBE_SYMBOL() is a
> better way to do this enabling the symbol to be discovered as being
> blacklisted, change over to using NOKPROBE_SYMBOL().
>

Oops, yes it should be.

Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

Thanks,

> Signed-off-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx>
> ---
> kernel/kprobes.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 699c5bc51a92..b52d952d6d41 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -1740,11 +1740,12 @@ void unregister_kprobes(struct kprobe **kps, int num)
> }
> EXPORT_SYMBOL_GPL(unregister_kprobes);
>
> -int __weak __kprobes kprobe_exceptions_notify(struct notifier_block *self,
> - unsigned long val, void *data)
> +int __weak kprobe_exceptions_notify(struct notifier_block *self,
> + unsigned long val, void *data)
> {
> return NOTIFY_DONE;
> }
> +NOKPROBE_SYMBOL(kprobe_exceptions_notify);
>
> static struct notifier_block kprobe_exceptions_nb = {
> .notifier_call = kprobe_exceptions_notify,
> --
> 2.11.1
>


--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>