[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aBoKnP4L-k8CweMy@krava>
Date: Tue, 6 May 2025 15:11:56 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Jiri Olsa <olsajiri@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alan Maguire <alan.maguire@...cle.com>,
David Laight <David.Laight@...lab.com>,
Thomas Weißschuh <thomas@...ch.de>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 03/22] uprobes: Move ref_ctr_offset update out
of uprobe_write_opcode
On Mon, Apr 28, 2025 at 12:51:57PM +0200, Jiri Olsa wrote:
> On Sun, Apr 27, 2025 at 04:13:35PM +0200, Oleg Nesterov wrote:
SNIP
> >
> > -------------------------------------------------------------------------------
> > OTOH, I think that the current logic is not really correct too,
> >
> > /* Revert back reference counter if instruction update failed. */
> > if (ret < 0 && is_register && ref_ctr_updated)
> > update_ref_ctr(uprobe, mm, -1);
> >
> > I think that "Revert back reference counter" logic should not depend on
> > is_register. Otherwise we can have the unbalanced update_ref_ctr(-1) if
> > uprobe_unregister() fails, then another uprobe_register() comes at the
> > same address, and after that uprobe_unregister() succeeds.
>
> sounds good to me
actualy after closer look, I don't see how this code could be triggered
in the first place.. any hint on how to hit such case? like:
- ref_ctr_offset is updated
- we fail somehow
- "if (ret < 0 && ref_ctr_updated)" is true on the way out
thanks,
jirka
Powered by blists - more mailing lists