From: Nam Cao <namcao@linutronix.de>
To: Gabriele Monaco <gmonaco@redhat.com>
Cc: Zhen Ni <zhen.ni@easystack.cn>,
linux-trace-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
mhiramat@kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] rv: Fix missing mutex unlock in rv_register_monitor()
Date: Thu, 4 Sep 2025 09:19:27 +0200 [thread overview]
Message-ID: <20250904071927.m3sY5lso@linutronix.de> (raw)
In-Reply-To: <8fa89db22320220e1bc411ded115f0a40097f961.camel@redhat.com>
On Thu, Sep 04, 2025 at 09:07:38AM +0200, Gabriele Monaco wrote:
> On Wed, 2025-09-03 at 14:51 +0800, Zhen Ni wrote:
> > If create_monitor_dir() fails, the function returns directly without
> > releasing rv_interface_lock. This leaves the mutex locked and causes
> > subsequent monitor registration attempts to deadlock.
> >
> > Fix it by making the error path jump to out_unlock, ensuring that the
> > mutex is always released before returning.
> >
> > Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct
> > rv_monitor")
> > Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
>
> Good catch, thank you!
>
> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
>
> I would also add a:
>
> Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor")
Am I hallucinating, or the fix tag is already there?
> (Adding Nam to the loop, as author of that patch)
Thanks for CC!
Reviewed-by: Nam Cao <namcao@linutronix.de>
I have been debating whether we should convert rv to use lock guard.
Problem like this one is a good advocate.
Nam
next prev parent reply other threads:[~2025-09-04 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 6:51 [PATCH] rv: Fix missing mutex unlock in rv_register_monitor() Zhen Ni
2025-09-04 7:07 ` Gabriele Monaco
2025-09-04 7:19 ` Nam Cao [this message]
2025-09-04 7:22 ` Gabriele Monaco
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=20250904071927.m3sY5lso@linutronix.de \
--to=namcao@linutronix.de \
--cc=gmonaco@redhat.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=zhen.ni@easystack.cn \
/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