]> www.infradead.org Git - users/hch/misc.git/commit
tracing: fprobe: Fix to lock module while registering fprobe
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Sun, 30 Mar 2025 03:34:47 +0000 (12:34 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 2 Apr 2025 14:18:57 +0000 (23:18 +0900)
commitd24fa977eec53399a9a49a2e1dc592430ea0a607
tree01356ff1ccfa0c86bb41e9561637dbe1042a50a8
parent38fec10eb60d687e30c8c6b5420d86e8149f7557
tracing: fprobe: Fix to lock module while registering fprobe

Since register_fprobe() does not get the module reference count while
registering fgraph filter, if the target functions (symbols) are in
modules, those modules can be unloaded when registering fprobe to
fgraph.

To avoid this issue, get the reference counter of module for each
symbol, and put it after register the fprobe.

Link: https://lore.kernel.org/all/174330568792.459674.16874380163991113156.stgit@devnote2/
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Closes: https://lore.kernel.org/all/20250325130628.3a9e234c@gandalf.local.home/
Fixes: 4346ba160409 ("fprobe: Rewrite fprobe on function-graph tracer")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/fprobe.c