]> git.ipfire.org Git - thirdparty/linux.git/commit
uprobes: Remove breakpoint in unapply_uprobe under mmap_write_lock
authorJiri Olsa <jolsa@kernel.org>
Sun, 20 Jul 2025 11:21:11 +0000 (13:21 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 21 Aug 2025 18:09:18 +0000 (20:09 +0200)
commit7769cb177b23142b83f22abd06e492cc25157893
tree8114d12dc3ba333eeaba472285514a8774d019bd
parent448f97fba9013ffa13f5dd82febd18836b189499
uprobes: Remove breakpoint in unapply_uprobe under mmap_write_lock

Currently unapply_uprobe takes mmap_read_lock, but it might call
remove_breakpoint which eventually changes user pages.

Current code writes either breakpoint or original instruction, so it can
go away with read lock as explained in here [1]. But with the upcoming
change that writes multiple instructions on the probed address we need
to ensure that any update to mm's pages is exclusive.

[1] https://lore.kernel.org/all/20240710140045.GA1084@redhat.com/

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250720112133.244369-2-jolsa@kernel.org
kernel/events/uprobes.c