Thread (3 messages) 3 messages, 3 authors, 2025-02-26

Re: [PATCH perf/core] uprobes: remove too strict lockdep_assert() condition in hprobe_expire()

From: Oleg Nesterov <oleg@redhat.com>
Date: 2025-02-26 11:30:48
Also in: bpf, lkml

On 02/25, Andrii Nakryiko wrote:
quoted hunk ↗ jump to hunk
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -762,10 +762,14 @@ static struct uprobe *hprobe_expire(struct hprobe *hprobe, bool get)
 	enum hprobe_state hstate;

 	/*
-	 * return_instance's hprobe is protected by RCU.
-	 * Underlying uprobe is itself protected from reuse by SRCU.
+	 * Caller should guarantee that return_instance is not going to be
+	 * freed from under us. This can be achieved either through holding
+	 * rcu_read_lock() or by owning return_instance in the first place.
+	 *
+	 * Underlying uprobe is itself protected from reuse by SRCU, so ensure
+	 * SRCU lock is held properly.
 	 */
-	lockdep_assert(rcu_read_lock_held() && srcu_read_lock_held(&uretprobes_srcu));
+	lockdep_assert(srcu_read_lock_held(&uretprobes_srcu));
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help