public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing/uprobe: Fix uprobe_perf_open probes iteration
@ 2021-11-23 14:28 Jiri Olsa
  2021-11-24  1:45 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Olsa @ 2021-11-23 14:28 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt
  Cc: lkml, Namhyung Kim, Arnaldo Carvalho de Melo, Ravi Bangoria,
	Ingo Molnar

Add missing 'tu' variable initialization in the probes loop,
otherwise the head 'tu' is used instead of added probes.

Fixes: 99c9a923e97a ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 kernel/trace/trace_uprobe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 0a5c0db3137e..f5f0039d31e5 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -1313,6 +1313,7 @@ static int uprobe_perf_open(struct trace_event_call *call,
 		return 0;
 
 	list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
+		tu = container_of(pos, struct trace_uprobe, tp);
 		err = uprobe_apply(tu->inode, tu->offset, &tu->consumer, true);
 		if (err) {
 			uprobe_perf_close(call, event);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tracing/uprobe: Fix uprobe_perf_open probes iteration
  2021-11-23 14:28 [PATCH] tracing/uprobe: Fix uprobe_perf_open probes iteration Jiri Olsa
@ 2021-11-24  1:45 ` Masami Hiramatsu
  0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2021-11-24  1:45 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Steven Rostedt, lkml, Namhyung Kim, Arnaldo Carvalho de Melo,
	Ravi Bangoria, Ingo Molnar

On Tue, 23 Nov 2021 15:28:01 +0100
Jiri Olsa <jolsa@redhat.com> wrote:

> Add missing 'tu' variable initialization in the probes loop,
> otherwise the head 'tu' is used instead of added probes.

Thanks for fixing this bug!

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

> 
> Fixes: 99c9a923e97a ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  kernel/trace/trace_uprobe.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> index 0a5c0db3137e..f5f0039d31e5 100644
> --- a/kernel/trace/trace_uprobe.c
> +++ b/kernel/trace/trace_uprobe.c
> @@ -1313,6 +1313,7 @@ static int uprobe_perf_open(struct trace_event_call *call,
>  		return 0;
>  
>  	list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
> +		tu = container_of(pos, struct trace_uprobe, tp);
>  		err = uprobe_apply(tu->inode, tu->offset, &tu->consumer, true);
>  		if (err) {
>  			uprobe_perf_close(call, event);
> -- 
> 2.32.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-24  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-23 14:28 [PATCH] tracing/uprobe: Fix uprobe_perf_open probes iteration Jiri Olsa
2021-11-24  1:45 ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox