]> git.ipfire.org Git - thirdparty/linux.git/commit
uprobes: Fix incorrect lockdep condition in filter_chain()
authorBreno Leitao <leitao@debian.org>
Wed, 28 Jan 2026 18:16:11 +0000 (10:16 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 2 Feb 2026 21:01:07 +0000 (22:01 +0100)
commita56a38fd9196fc89401e498d70b7aa9c9679fa6e
tree8295405f231538eb717779a08f76a7f857f1472b
parent171efc70097a9f5f207461bed03478a1b0a3dfa6
uprobes: Fix incorrect lockdep condition in filter_chain()

The list_for_each_entry_rcu() in filter_chain() uses
rcu_read_lock_trace_held() as the lockdep condition, but the function
holds consumer_rwsem, not the RCU trace lock.

This gives me the following output when running with some locking debug
option enabled:

  kernel/events/uprobes.c:1141 RCU-list traversed in non-reader section!!
    filter_chain
    register_for_each_vma
    uprobe_unregister_nosync
    __probe_event_disable

Remove the incorrect lockdep condition since the rwsem provides
sufficient protection for the list traversal.

Fixes: cc01bd044e6a ("uprobes: travers uprobe's consumer list locklessly under SRCU protection")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260128-uprobe_rcu-v2-1-994ea6d32730@debian.org
kernel/events/uprobes.c