diff options
author | Jason Baron <jbaron@redhat.com> | 2010-10-01 17:23:48 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-10-28 09:17:40 -0400 |
commit | 91bad2f8d3057482b9afb599f14421b007136960 (patch) | |
tree | ea5e09e74107593dcfc192c65c1395ed22674df4 /include | |
parent | b842f8faf6c7dc2005c6a70631c1a91bac02f180 (diff) |
jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex
register_kprobe() downs the 'text_mutex' and then calls
jump_label_text_reserved(), which downs the 'jump_label_mutex'.
However, the jump label code takes those mutexes in the reverse
order.
Fix by requiring the caller of jump_label_text_reserved() to do
the jump label locking via the newly added: jump_label_lock(),
jump_label_unlock(). Currently, kprobes is the only user
of jump_label_text_reserved().
Reported-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
LKML-Reference: <759032c48d5e30c27f0bba003d09bffa8e9f28bb.1285965957.git.jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/jump_label.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index b67cb180e6e9..1947a1212678 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -18,6 +18,8 @@ struct module; | |||
18 | extern struct jump_entry __start___jump_table[]; | 18 | extern struct jump_entry __start___jump_table[]; |
19 | extern struct jump_entry __stop___jump_table[]; | 19 | extern struct jump_entry __stop___jump_table[]; |
20 | 20 | ||
21 | extern void jump_label_lock(void); | ||
22 | extern void jump_label_unlock(void); | ||
21 | extern void arch_jump_label_transform(struct jump_entry *entry, | 23 | extern void arch_jump_label_transform(struct jump_entry *entry, |
22 | enum jump_label_type type); | 24 | enum jump_label_type type); |
23 | extern void arch_jump_label_text_poke_early(jump_label_t addr); | 25 | extern void arch_jump_label_text_poke_early(jump_label_t addr); |
@@ -59,6 +61,9 @@ static inline int jump_label_text_reserved(void *start, void *end) | |||
59 | return 0; | 61 | return 0; |
60 | } | 62 | } |
61 | 63 | ||
64 | static inline void jump_label_lock(void) {} | ||
65 | static inline void jump_label_unlock(void) {} | ||
66 | |||
62 | #endif | 67 | #endif |
63 | 68 | ||
64 | #define COND_STMT(key, stmt) \ | 69 | #define COND_STMT(key, stmt) \ |