From: Steven Rostedt <rostedt@goodmis.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-kernel@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] tracing: Fix missing trace_boot_init_histograms kstrdup NULL checks
Date: Mon, 25 Oct 2021 23:10:17 -0400 [thread overview]
Message-ID: <20211025231017.01204974@rorschach.local.home> (raw)
In-Reply-To: <20211015195550.22742-1-mathieu.desnoyers@efficios.com>
On Fri, 15 Oct 2021 15:55:50 -0400
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> trace_boot_init_histograms misses NULL pointer checks for kstrdup
> failure.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
Masami,
Can you ack this?
-- Steve
> ---
> kernel/trace/trace_boot.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
> index 8d252f63cd78..0580287d7a0d 100644
> --- a/kernel/trace/trace_boot.c
> +++ b/kernel/trace/trace_boot.c
> @@ -430,6 +430,8 @@ trace_boot_init_histograms(struct trace_event_file *file,
> /* All digit started node should be instances. */
> if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
> tmp = kstrdup(buf, GFP_KERNEL);
> + if (!tmp)
> + return;
> if (trigger_process_regex(file, buf) < 0)
> pr_err("Failed to apply hist trigger: %s\n", tmp);
> kfree(tmp);
> @@ -439,6 +441,8 @@ trace_boot_init_histograms(struct trace_event_file *file,
> if (xbc_node_find_subkey(hnode, "keys")) {
> if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0) {
> tmp = kstrdup(buf, GFP_KERNEL);
> + if (!tmp)
> + return;
> if (trigger_process_regex(file, buf) < 0)
> pr_err("Failed to apply hist trigger: %s\n", tmp);
> kfree(tmp);
next prev parent reply other threads:[~2021-10-26 3:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 19:55 Mathieu Desnoyers
2021-10-26 3:10 ` Steven Rostedt [this message]
2021-10-26 8:27 ` Masami Hiramatsu
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=20211025231017.01204974@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@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®