From: "tip-bot2 for Andrii Nakryiko" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Oleg Nesterov <oleg@redhat.com>,
Andrii Nakryiko <andrii@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] uprobes: simplify find_active_uprobe_rcu() VMA checks
Date: Mon, 02 Dec 2024 11:14:08 -0000 [thread overview]
Message-ID: <173313804898.412.14244739462302123654.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241122035922.3321100-2-andrii@kernel.org>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 83e3dc9a5d4d7402adb24090a77327245d593129
Gitweb: https://git.kernel.org/tip/83e3dc9a5d4d7402adb24090a77327245d593129
Author: Andrii Nakryiko <andrii@kernel.org>
AuthorDate: Thu, 21 Nov 2024 19:59:21 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 02 Dec 2024 12:01:38 +01:00
uprobes: simplify find_active_uprobe_rcu() VMA checks
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.
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20241122035922.3321100-2-andrii@kernel.org
---
kernel/events/uprobes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index fa04b14..62c14df 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -2304,7 +2304,7 @@ static struct uprobe *find_active_uprobe_rcu(unsigned long bp_vaddr, int *is_swb
mmap_read_lock(mm);
vma = vma_lookup(mm, bp_vaddr);
if (vma) {
- if (valid_vma(vma, false)) {
+ if (vma->vm_file) {
struct inode *inode = file_inode(vma->vm_file);
loff_t offset = vaddr_to_offset(vma, bp_vaddr);
next prev parent reply other threads:[~2024-12-02 11:14 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
2024-12-02 11:14 ` tip-bot2 for Andrii Nakryiko [this message]
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=173313804898.412.14244739462302123654.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=andrii@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®