diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-04-17 04:18:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-04-24 04:26:39 -0400 |
commit | b40a2cb6e0c218c6d0f12c7f7e683e75972973c1 (patch) | |
tree | 6d69ce70401f143118479917577a0dbeff99eebd | |
parent | 3da0f18007e5b87b573cf6ae8c445d59e757d274 (diff) |
kprobes, notifier: Use NOKPROBE_SYMBOL macro in notifier
Use NOKPROBE_SYMBOL macro to protect functions from
kprobes instead of __kprobes annotation in notifier.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20140417081835.26341.56128.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/notifier.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/notifier.c b/kernel/notifier.c index db4c8b08a50c..4803da6eab62 100644 --- a/kernel/notifier.c +++ b/kernel/notifier.c | |||
@@ -71,9 +71,9 @@ static int notifier_chain_unregister(struct notifier_block **nl, | |||
71 | * @returns: notifier_call_chain returns the value returned by the | 71 | * @returns: notifier_call_chain returns the value returned by the |
72 | * last notifier function called. | 72 | * last notifier function called. |
73 | */ | 73 | */ |
74 | static int __kprobes notifier_call_chain(struct notifier_block **nl, | 74 | static int notifier_call_chain(struct notifier_block **nl, |
75 | unsigned long val, void *v, | 75 | unsigned long val, void *v, |
76 | int nr_to_call, int *nr_calls) | 76 | int nr_to_call, int *nr_calls) |
77 | { | 77 | { |
78 | int ret = NOTIFY_DONE; | 78 | int ret = NOTIFY_DONE; |
79 | struct notifier_block *nb, *next_nb; | 79 | struct notifier_block *nb, *next_nb; |
@@ -102,6 +102,7 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl, | |||
102 | } | 102 | } |
103 | return ret; | 103 | return ret; |
104 | } | 104 | } |
105 | NOKPROBE_SYMBOL(notifier_call_chain); | ||
105 | 106 | ||
106 | /* | 107 | /* |
107 | * Atomic notifier chain routines. Registration and unregistration | 108 | * Atomic notifier chain routines. Registration and unregistration |
@@ -172,9 +173,9 @@ EXPORT_SYMBOL_GPL(atomic_notifier_chain_unregister); | |||
172 | * Otherwise the return value is the return value | 173 | * Otherwise the return value is the return value |
173 | * of the last notifier function called. | 174 | * of the last notifier function called. |
174 | */ | 175 | */ |
175 | int __kprobes __atomic_notifier_call_chain(struct atomic_notifier_head *nh, | 176 | int __atomic_notifier_call_chain(struct atomic_notifier_head *nh, |
176 | unsigned long val, void *v, | 177 | unsigned long val, void *v, |
177 | int nr_to_call, int *nr_calls) | 178 | int nr_to_call, int *nr_calls) |
178 | { | 179 | { |
179 | int ret; | 180 | int ret; |
180 | 181 | ||
@@ -184,13 +185,15 @@ int __kprobes __atomic_notifier_call_chain(struct atomic_notifier_head *nh, | |||
184 | return ret; | 185 | return ret; |
185 | } | 186 | } |
186 | EXPORT_SYMBOL_GPL(__atomic_notifier_call_chain); | 187 | EXPORT_SYMBOL_GPL(__atomic_notifier_call_chain); |
188 | NOKPROBE_SYMBOL(__atomic_notifier_call_chain); | ||
187 | 189 | ||
188 | int __kprobes atomic_notifier_call_chain(struct atomic_notifier_head *nh, | 190 | int atomic_notifier_call_chain(struct atomic_notifier_head *nh, |
189 | unsigned long val, void *v) | 191 | unsigned long val, void *v) |
190 | { | 192 | { |
191 | return __atomic_notifier_call_chain(nh, val, v, -1, NULL); | 193 | return __atomic_notifier_call_chain(nh, val, v, -1, NULL); |
192 | } | 194 | } |
193 | EXPORT_SYMBOL_GPL(atomic_notifier_call_chain); | 195 | EXPORT_SYMBOL_GPL(atomic_notifier_call_chain); |
196 | NOKPROBE_SYMBOL(atomic_notifier_call_chain); | ||
194 | 197 | ||
195 | /* | 198 | /* |
196 | * Blocking notifier chain routines. All access to the chain is | 199 | * Blocking notifier chain routines. All access to the chain is |
@@ -527,7 +530,7 @@ EXPORT_SYMBOL_GPL(srcu_init_notifier_head); | |||
527 | 530 | ||
528 | static ATOMIC_NOTIFIER_HEAD(die_chain); | 531 | static ATOMIC_NOTIFIER_HEAD(die_chain); |
529 | 532 | ||
530 | int notrace __kprobes notify_die(enum die_val val, const char *str, | 533 | int notrace notify_die(enum die_val val, const char *str, |
531 | struct pt_regs *regs, long err, int trap, int sig) | 534 | struct pt_regs *regs, long err, int trap, int sig) |
532 | { | 535 | { |
533 | struct die_args args = { | 536 | struct die_args args = { |
@@ -540,6 +543,7 @@ int notrace __kprobes notify_die(enum die_val val, const char *str, | |||
540 | }; | 543 | }; |
541 | return atomic_notifier_call_chain(&die_chain, val, &args); | 544 | return atomic_notifier_call_chain(&die_chain, val, &args); |
542 | } | 545 | } |
546 | NOKPROBE_SYMBOL(notify_die); | ||
543 | 547 | ||
544 | int register_die_notifier(struct notifier_block *nb) | 548 | int register_die_notifier(struct notifier_block *nb) |
545 | { | 549 | { |