From: Oleg Nesterov <oleg@redhat.com>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] uprobes: Skip remove_breakpoint() if UPROBE_COPY_INSN is not set
Date: Thu, 3 Dec 2026 12:58:50 +0100 [thread overview]
Message-ID: <axFZeslQUWCfJ1Ac@redhat.com> (raw)
In-Reply-To: <179629194562.2709886.5573348043761281153.stgit@mhiramat.c.googlers.com>
On 12/03, Masami Hiramatsu (Google) wrote:
>
> @@ -1194,6 +1197,19 @@ static int remove_breakpoint(struct uprobe *uprobe, struct vm_area_struct *vma,
> {
> struct mm_struct *mm = vma->vm_mm;
>
> + /* No breakpoint was ever installed if prepare_uprobe() never succeeded */
> + if (!test_bit(UPROBE_COPY_INSN, &uprobe->flags))
> + return 0;
> +
> + /*
> + * Pairs with the smp_wmb() in prepare_uprobe().
> + *
> + * Guarantees that if we see the UPROBE_COPY_INSN bit set, then
> + * we must also see the stores to &uprobe->arch before
> + * set_orig_insn() reads them.
> + */
> + smp_rmb();
Acked-by: Oleg Nesterov <oleg@redhat.com>
But again, it can use test_bit_acquire() unless I am confused.
And perhaps it would be better to change uprobe_unregister_nosync()
to check UPROBE_COPY_INSN once?
In any case UPROBE_COPY_INSN must die ;) see the TODO comment in
prepare_uprobe().
Oleg.
prev parent reply other threads:[~2026-12-03 11:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 9:58 [PATCH 0/2] uprobes: Fix UPROBE_COPY_INSN ordering and breakpoint removal Masami Hiramatsu (Google)
2026-12-03 9:58 ` [PATCH 1/2] uprobes: Add missing read memory barrier in prepare_uprobe() Masami Hiramatsu (Google)
2026-12-03 11:19 ` Oleg Nesterov
2026-12-03 9:59 ` [PATCH 2/2] uprobes: Skip remove_breakpoint() if UPROBE_COPY_INSN is not set Masami Hiramatsu (Google)
2026-12-03 10:17 ` sashiko-bot
2026-12-03 11:58 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axFZeslQUWCfJ1Ac@redhat.com \
--to=oleg@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox