All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	andrii@kernel.org, mhiramat@kernel.org, peterz@infradead.org,
	rostedt@goodmis.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] uprobes: make uprobe_register() return struct uprobe *
Date: Thu, 1 Aug 2024 14:26:45 +0200	[thread overview]
Message-ID: <20240801122644.GC4038@redhat.com> (raw)
In-Reply-To: <Zqt8UPBC7zAWDMHD@krava>

On 08/01, Jiri Olsa wrote:
>
> > Note the additional path_put() in testmod_unregister_uprobe(). Does it need
> > a separate patch or can it come with 5/5 ?
>
> I think it'd be better to have it separately, the test is already
> released.. so people might want to backport just the fix

OK, I'll rebase and add the patch below to v4. OK?

Oleg.
---

From f6bf42015048938d826880e3bf4a318bb64a05b4 Mon Sep 17 00:00:00 2001
From: Oleg Nesterov <oleg@redhat.com>
Date: Thu, 1 Aug 2024 14:21:47 +0200
Subject: [PATCH] selftests/bpf: fix uprobe.path leak in bpf_testmod

From: Jiri Olsa <olsajiri@gmail.com>

testmod_unregister_uprobe() forgets to path_put(&uprobe.path).

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
index 86babdd6f850..55f6905de743 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
@@ -477,6 +477,7 @@ static void testmod_unregister_uprobe(void)
 	if (uprobe.offset) {
 		uprobe_unregister(d_real_inode(uprobe.path.dentry),
 				  uprobe.offset, &uprobe.consumer);
+		path_put(&uprobe.path);
 		uprobe.offset = 0;
 	}
 
-- 
2.25.1.362.g51ebf55



  reply	other threads:[~2024-08-01 12:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 13:44 [PATCH v2 0/5] uprobes: misc cleanups/simplifications Oleg Nesterov
2024-07-29 13:45 ` [PATCH v2 1/5] uprobes: document the usage of mm->mmap_lock Oleg Nesterov
2024-07-29 13:45 ` [PATCH v2 2/5] uprobes: is_trap_at_addr: don't use get_user_pages_remote() Oleg Nesterov
2024-07-29 13:45 ` [PATCH v2 3/5] uprobes: simplify error handling for alloc_uprobe() Oleg Nesterov
2024-07-29 13:45 ` [PATCH v2 4/5] uprobes: kill uprobe_register_refctr() Oleg Nesterov
2024-07-31  5:37   ` Masami Hiramatsu
2024-07-31  7:56     ` Oleg Nesterov
2024-07-31  8:10   ` [PATCH v3 " Oleg Nesterov
2024-07-29 13:45 ` [PATCH v2 5/5] uprobes: make uprobe_register() return struct uprobe * Oleg Nesterov
2024-07-31  5:39   ` Masami Hiramatsu
2024-07-31  7:44     ` Oleg Nesterov
2024-07-31 16:18   ` Andrii Nakryiko
2024-07-31 16:56     ` Peter Zijlstra
2024-07-31 17:01       ` Andrii Nakryiko
2024-07-31 17:05         ` Peter Zijlstra
2024-07-31 17:12           ` Andrii Nakryiko
2024-07-31 17:24             ` Oleg Nesterov
2024-07-31 17:17           ` Oleg Nesterov
2024-08-01 13:10             ` Peter Zijlstra
2024-08-01 11:32     ` Jiri Olsa
2024-08-01 12:00       ` Oleg Nesterov
2024-08-01 12:15         ` Jiri Olsa
2024-08-01 12:26           ` Oleg Nesterov [this message]
2024-08-01 13:07             ` Jiri Olsa
2024-07-30  7:42 ` [PATCH v2 0/5] uprobes: misc cleanups/simplifications Jiri Olsa

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=20240801122644.GC4038@redhat.com \
    --to=oleg@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=olsajiri@gmail.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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.