Skip to content

Commit bdc9f37

Browse files
committed
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 <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent 0ef7653 commit bdc9f37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/jump_label.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,14 @@ static int __jump_label_mod_text_reserved(void *start, void *end)
284284
{
285285
struct module *mod;
286286

287+
preempt_disable();
287288
mod = __module_text_address((unsigned long)start);
289+
WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
290+
preempt_enable();
291+
288292
if (!mod)
289293
return 0;
290294

291-
WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
292295

293296
return __jump_label_text_reserved(mod->jump_entries,
294297
mod->jump_entries + mod->num_jump_entries,

0 commit comments

Comments
 (0)