From: Oleg Nesterov <oleg@redhat.com>
To: Jann Horn <jannh@google.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, peterz@infradead.org,
mingo@kernel.org, torvalds@linux-foundation.org,
rostedt@goodmis.org, mhiramat@kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org, jolsa@kernel.org,
paulmck@kernel.org, willy@infradead.org, surenb@google.com,
mjguzik@gmail.com, brauner@kernel.org, mhocko@kernel.org,
vbabka@suse.cz, shakeel.butt@linux.dev, hannes@cmpxchg.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
david@redhat.com, arnd@arndb.de, viro@zeniv.linux.org.uk,
hca@linux.ibm.com
Subject: Re: [PATCH v5 tip/perf/core 1/2] uprobes: simplify find_active_uprobe_rcu() VMA checks
Date: Wed, 27 Nov 2024 09:01:56 +0100 [thread overview]
Message-ID: <20241127080133.GA7717@redhat.com> (raw)
In-Reply-To: <CAG48ez06=E-rXYk59yJR2aKFD2yaqcQu+6wqVau9pQ8X36A+aQ@mail.gmail.com>
On 11/26, Jann Horn wrote:
>
> On Fri, Nov 22, 2024 at 4:59 AM Andrii Nakryiko <andrii@kernel.org> wrote:
> > At the point where find_active_uprobe_rcu() is used we know that VMA in
> > question has triggered software breakpoint, so we don't need to validate
> > vma->vm_flags. Keep only vma->vm_file NULL check.
>
> How do we know that the VMA we find triggered a software breakpoint?
> Between the time a software breakpoint was hit and the time we took
> the mmap_read_lock(), the VMA could have been replaced with an
> entirely different one, right?
Right, but this doesn't really differ from the case when another thread
replaces (or even unmaps) this VMA after find_active_uprobe_rcu() drops
mm->mmap_lock and returns a found uprobe.
So I think this is fine.
Oleg.
next prev parent reply other threads:[~2024-11-27 8:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 3:59 [PATCH v5 tip/perf/core 0/2] uprobes: speculative lockless VMA-to-uprobe lookup Andrii Nakryiko
2024-11-22 3:59 ` [PATCH v5 tip/perf/core 1/2] uprobes: simplify find_active_uprobe_rcu() VMA checks Andrii Nakryiko
2024-11-26 22:19 ` Jann Horn
2024-11-27 4:49 ` Andrii Nakryiko
2024-11-27 8:01 ` Oleg Nesterov [this message]
2024-12-02 11:14 ` [tip: perf/core] " tip-bot2 for Andrii Nakryiko
2024-11-22 3:59 ` [PATCH v5 tip/perf/core 2/2] uprobes: add speculative lockless VMA-to-inode-to-uprobe resolution Andrii Nakryiko
2024-11-22 14:56 ` Liam R. Howlett
2024-12-02 11:14 ` [tip: perf/core] " tip-bot2 for Andrii Nakryiko
2024-11-22 11:07 ` [PATCH v5 tip/perf/core 0/2] uprobes: speculative lockless VMA-to-uprobe lookup Peter Zijlstra
2024-11-22 15:04 ` Suren Baghdasaryan
2024-11-22 17:48 ` Suren Baghdasaryan
2024-11-23 20:35 ` Peter Zijlstra
2024-11-24 19:56 ` Suren Baghdasaryan
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=20241127080133.GA7717@redhat.com \
--to=oleg@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=arnd@arndb.de \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=hca@linux.ibm.com \
--cc=jannh@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhiramat@kernel.org \
--cc=mhocko@kernel.org \
--cc=mingo@kernel.org \
--cc=mjguzik@gmail.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=torvalds@linux-foundation.org \
--cc=vbabka@suse.cz \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.