Skip to content

Commit 83e3dc9

Browse files
anakryikoPeter Zijlstra
authored andcommitted
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
1 parent 03a001b commit 83e3dc9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/events/uprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ static struct uprobe *find_active_uprobe_rcu(unsigned long bp_vaddr, int *is_swb
23042304
mmap_read_lock(mm);
23052305
vma = vma_lookup(mm, bp_vaddr);
23062306
if (vma) {
2307-
if (valid_vma(vma, false)) {
2307+
if (vma->vm_file) {
23082308
struct inode *inode = file_inode(vma->vm_file);
23092309
loff_t offset = vaddr_to_offset(vma, bp_vaddr);
23102310

0 commit comments

Comments
 (0)