]> git.ipfire.org Git - thirdparty/linux.git/commit
tracing: Replace BUG_ON with lockdep_assert_held in uprobe_buffer functions
authorYash Suthar <yashsuthar983@gmail.com>
Mon, 1 Jun 2026 14:35:21 +0000 (23:35 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 1 Jun 2026 14:35:21 +0000 (23:35 +0900)
commit585abc02be3d3ab82fbcc4dbcbbf0ceb61a02129
tree8beef641920d7ced2140152982169f4b2afe5363
parentcf24cbb4e5861caacfdb5bface90b80eaa26e649
tracing: Replace BUG_ON with lockdep_assert_held in uprobe_buffer functions

Replace BUG_ON(!mutex_is_locked(&event_mutex)) with
lockdep_assert_held(&event_mutex) in uprobe_buffer_enable() and
uprobe_buffer_disable().

BUG_ON() will crash the kernel. mutex_is_locked() only checks
if any task holds lock,but not the caller task. lockdep_assert_held()
also check current task for lock and no crash on true condition.

Link: https://lore.kernel.org/all/20260521192846.8306-1-yashsuthar983@gmail.com/
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/trace_uprobe.c