From: Steven Rostedt <rostedt@goodmis.org>
To: "XueBing Chen" <chenxuebing@jari.cn>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: use strscpy to replace strlcpy
Date: Mon, 11 Jul 2022 12:10:14 -0400 [thread overview]
Message-ID: <20220711121014.6f9e75cb@gandalf.local.home> (raw)
In-Reply-To: <20220711104125.1d9ba146@gandalf.local.home>
On Mon, 11 Jul 2022 10:41:25 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 11 Jul 2022 22:26:12 +0800 (GMT+08:00)
> "XueBing Chen" <chenxuebing@jari.cn> wrote:
>
> > The strlcpy should not be used because it doesn't limit the source
> > length. Preferred is strscpy.
>
> That's not enough justification to make the switch.
>
> These calls are done at boot up. If there's a bug in the source, I rather
> have it crash.
And unless there is good justification and understanding of how the code
works, blindly switching strlcpy() with strscpy() can have undesirable
consequences:
https://lore.kernel.org/all/20220701094403.3044-1-adrian.hunter@intel.com/T/#u
Please stop changing all strlcpy() to strscpy() unless there's good
justification to do so. Just saying "strscpy() is preferred", is not
justification to make the change.
-- Steve
prev parent reply other threads:[~2022-07-11 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 14:26 XueBing Chen
2022-07-11 14:41 ` Steven Rostedt
2022-07-11 16:10 ` 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=20220711121014.6f9e75cb@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=chenxuebing@jari.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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®