The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: probes: Replace strcpy() with memcpy() in __trace_probe_log_err()
Date: Mon, 25 Aug 2025 16:05:40 +0900	[thread overview]
Message-ID: <20250825160540.9a5272a8a93a789eb36a7098@kernel.org> (raw)
In-Reply-To: <20250820214717.778243-3-thorsten.blum@linux.dev>

On Wed, 20 Aug 2025 23:47:18 +0200
Thorsten Blum <thorsten.blum@linux.dev> wrote:

> strcpy() is deprecated; use memcpy() instead.
> 
> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

OK, looks good to me.

Thanks,

> ---
>  kernel/trace/trace_probe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index 5cbdc423afeb..d3ba5869d32c 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -214,7 +214,7 @@ void __trace_probe_log_err(int offset, int err_type)
>  	p = command;
>  	for (i = 0; i < trace_probe_log.argc; i++) {
>  		len = strlen(trace_probe_log.argv[i]);
> -		strcpy(p, trace_probe_log.argv[i]);
> +		memcpy(p, trace_probe_log.argv[i], len);
>  		p[len] = ' ';
>  		p += len + 1;
>  	}
> -- 
> 2.50.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2025-08-25  7:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 21:47 [PATCH] tracing: probes: Replace strcpy() with memcpy() in __trace_probe_log_err() Thorsten Blum
2025-08-25  7:05 ` Masami Hiramatsu [this message]
2025-09-08 10:13   ` Thorsten Blum
2025-09-08 23:53     ` Masami Hiramatsu
2025-10-07 23:14       ` Steven Rostedt
2025-10-07 23:57         ` 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=20250825160540.9a5272a8a93a789eb36a7098@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rostedt@goodmis.org \
    --cc=thorsten.blum@linux.dev \
    /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