[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241028105123.c97544285c7e3304138c5a40@kernel.org>
Date: Mon, 28 Oct 2024 10:51:23 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Andrii Nakryiko <andrii@...nel.org>
Cc: linux-trace-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, peterz@...radead.org, oleg@...hat.com,
rostedt@...dmis.org, mhiramat@...nel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, jolsa@...nel.org, paulmck@...nel.org,
willy@...radead.org, surenb@...gle.com, mjguzik@...il.com,
brauner@...nel.org, jannh@...gle.com, mhocko@...nel.org, vbabka@...e.cz,
shakeel.butt@...ux.dev, hannes@...xchg.org, Liam.Howlett@...cle.com,
lorenzo.stoakes@...cle.com, david@...hat.com, arnd@...db.de,
richard.weiyang@...il.com, zhangpeng.00@...edance.com,
linmiaohe@...wei.com, viro@...iv.linux.org.uk, hca@...ux.ibm.com
Subject: Re: [PATCH v4 tip/perf/core 3/4] uprobes: simplify
find_active_uprobe_rcu() VMA checks
On Sun, 27 Oct 2024 18:08:17 -0700
Andrii Nakryiko <andrii@...nel.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.
>
Looks good to me.
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
Thanks,
> Acked-by: Oleg Nesterov <oleg@...hat.com>
> Suggested-by: Oleg Nesterov <oleg@...hat.com>
> Signed-off-by: Andrii Nakryiko <andrii@...nel.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 4ef4b51776eb..290c445768fa 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -2084,7 +2084,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);
>
> --
> 2.43.5
>
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists