diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2016-07-26 22:47:35 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2016-08-03 20:46:54 -0400 |
commit | bdc9f373551dd3f1e6fae1618f2394ee9bc7db2e (patch) | |
tree | 544ec1154b88d6e39134f4d2bf7b3110639ba8ee | |
parent | 0ef7653797addea8ba1bf97f8208a54a62498d94 (diff) |
jump_label: disable preemption around __module_text_address().
Steven reported a warning caused by not holding module_mutex or
rcu_read_lock_sched: his backtrace was corrupted but a quick audit
found this possible cause. It's wrong anyway...
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | kernel/jump_label.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 0dbea887d625..0eef93962a91 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c | |||
@@ -284,11 +284,14 @@ static int __jump_label_mod_text_reserved(void *start, void *end) | |||
284 | { | 284 | { |
285 | struct module *mod; | 285 | struct module *mod; |
286 | 286 | ||
287 | preempt_disable(); | ||
287 | mod = __module_text_address((unsigned long)start); | 288 | mod = __module_text_address((unsigned long)start); |
289 | WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod); | ||
290 | preempt_enable(); | ||
291 | |||
288 | if (!mod) | 292 | if (!mod) |
289 | return 0; | 293 | return 0; |
290 | 294 | ||
291 | WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod); | ||
292 | 295 | ||
293 | return __jump_label_text_reserved(mod->jump_entries, | 296 | return __jump_label_text_reserved(mod->jump_entries, |
294 | mod->jump_entries + mod->num_jump_entries, | 297 | mod->jump_entries + mod->num_jump_entries, |