kprobes: Fix a double lock bug of kprobe_mutex
Fix a double locking bug caused when debug.kprobe-optimization=0.
While the proc_kprobes_optimization_handler locks kprobe_mutex,
wait_for_kprobe_optimizer locks it again and that causes a double lock.
To fix the bug, this introduces different mutex for protecting
sysctl parameter and locks it in proc_kprobes_optimization_handler.
Of course, since we need to lock kprobe_mutex when touching kprobes
resources, that is done in *optimize_all_kprobes().
This bug was introduced by commit ad72b3bea744 ("kprobes: fix
Signed-off-by: Masami Hiramatsu <email@example.com>
Acked-by: Ananth N Mavinakayanahalli <firstname.lastname@example.org>
Cc: Ingo Molnar <email@example.com>
Cc: Tejun Heo <firstname.lastname@example.org>
Cc: "David S. Miller" <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
1 file changed