From: Thorsten Blum <thorsten.blum@linux.dev>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: yang.yang29@zte.com.cn, mhiramat@kernel.org,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
xu.panda@zte.com.cn, linux-hardening@vger.kernel.org,
Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH linux-next] tracing: use strscpy() to instead of strncpy()
Date: Fri, 14 Feb 2025 23:27:00 +0100 [thread overview]
Message-ID: <13330090-9D89-4AAE-B59E-7353AE319654@linux.dev> (raw)
In-Reply-To: <20230124121703.1e3a1ac4@gandalf.local.home>
Hi Steven,
I was about to submit the same patch when I found this one from 2023.
On 24. Jan 2023, at 18:17, Steven Rostedt wrote:
> So the above will *always* return -E2BIG *and* not end buf[] with '\0' as
> if strscpy() returns -E2BIG, then buf[] is not guaranteed to be
> NUL-terminated.
The return value is not used and the strscpy() documentation in
linux/string.h says:
"The destination @dst buffer is always NUL terminated, unless it's zero-
sized." and "Preferred to strncpy() since it always returns a valid
string, ..."
Has strscpy() changed since 2023 or could this patch be revisited? I saw
that Justin also made an effort in September 2024 [1] to revisit it and
to remove the deprecated strncpy() here.
> NACK!
>
> -- Steve
Thanks,
Thorsten
[1] https://lore.kernel.org/r/yhv3rzg6vhgwage27cyvg72t4vwf5x3tdtj3zjipryzvz3u55x@c33q753uxyi3/
Cc: linux-hardening@vger.kernel.org
prev parent reply other threads:[~2025-02-14 22:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 11:39 [PATCH linux-next] tracing: use strscpy() to instead of strncpy() yang.yang29
2023-01-10 0:03 ` Masami Hiramatsu
2023-01-24 17:17 ` Steven Rostedt
2024-10-01 1:33 ` Justin Stitt
2025-02-14 22:27 ` Thorsten Blum [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=13330090-9D89-4AAE-B59E-7353AE319654@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=justinstitt@google.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=xu.panda@zte.com.cn \
--cc=yang.yang29@zte.com.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