Files
linux-stable-mirror/kernel
Masami Hiramatsu (Google) 868df4eb78 tracing: fprobe events: Fix possible UAF on modules
commit dd941507a9 upstream.

Commit ac91052f0a ("tracing: tprobe-events: Fix leakage of module
refcount") moved try_module_get() from __find_tracepoint_module_cb()
to find_tracepoint() caller, but that introduced a possible UAF
because the module can be unloaded before try_module_get(). In this
case, the module object should be freed too. Thus, try_module_get()
does not only fail but may access to the freed object.

To avoid that, try_module_get() in __find_tracepoint_module_cb()
again.

Link: https://lore.kernel.org/all/174342990779.781946.9138388479067729366.stgit@devnote2/

Fixes: ac91052f0a ("tracing: tprobe-events: Fix leakage of module refcount")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-20 10:15:50 +02:00
..
2024-10-09 12:47:19 -07:00
2024-09-03 21:15:26 -07:00
2025-02-08 09:57:35 +01:00
2024-09-27 08:18:43 -07:00