Skip to content

Commit

Permalink
jump_label: disable preemption around __module_text_address().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell committed Aug 4, 2016
1 parent 0ef7653 commit bdc9f37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,14 @@ static int __jump_label_mod_text_reserved(void *start, void *end)
{
struct module *mod;

preempt_disable();
mod = __module_text_address((unsigned long)start);
WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
preempt_enable();

if (!mod)
return 0;

WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);

return __jump_label_text_reserved(mod->jump_entries,
mod->jump_entries + mod->num_jump_entries,
Expand Down

0 comments on commit bdc9f37

Please sign in to comment.