From: Steven Rostedt <rostedt@goodmis.org>
To: Song Liu <song@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <kernel-team@fb.com>,
"Naveen N . Rao" <naveen.n.rao@linux.vnet.ibm.com>
Subject: Re: [PATCH] ftrace: fix recursive locking direct_mutex in ftrace_modify_direct_caller
Date: Sat, 24 Sep 2022 11:01:13 -0400 [thread overview]
Message-ID: <20220924110113.64c6701b@rorschach.local.home> (raw)
In-Reply-To: <20220919172955.1196326-1-song@kernel.org>
On Mon, 19 Sep 2022 10:29:55 -0700
Song Liu <song@kernel.org> wrote:
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 439e2ab6905e..d308d0674805 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -5461,7 +5461,7 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
> if (ret)
> goto out_lock;
>
> - ret = register_ftrace_function(&stub_ops);
> + ret = register_ftrace_function_nolock(&stub_ops);
> if (ret) {
> ftrace_set_filter_ip(&stub_ops, ip, 1, 0);
> goto out_lock;
> --
We need to update the comments to this function, as well add an:
#define lock_direct_assert_held() lockdep_assert_held(&direct_mutex);
And call that in this function. Otherwise, we can be calling this code
without it held and cause races.
-- Steve
prev parent reply other threads:[~2022-09-24 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 17:29 Song Liu
2022-09-24 0:54 ` Song Liu
2022-09-24 15:01 ` Steven Rostedt [this message]
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=20220924110113.64c6701b@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=song@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®