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.
Signed-off-by: Yash Suthar <redacted>
---
kernel/trace/trace_uprobe.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Steven Rostedt <rostedt@goodmis.org> Date: 2026-05-21 22:15:43
On Fri, 22 May 2026 00:58:46 +0530
Yash Suthar [off-list ref] wrote:
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.
Signed-off-by: Yash Suthar <redacted>
This looks good to me.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Masami, do you want to take this?
-- Steve
On Thu, 21 May 2026 18:16:01 -0400
Steven Rostedt [off-list ref] wrote:
On Fri, 22 May 2026 00:58:46 +0530
Yash Suthar [off-list ref] wrote:
quoted
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.
Signed-off-by: Yash Suthar <redacted>
This looks good to me.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Masami, do you want to take this?