From: David Sterba <dsterba@suse.cz>
To: Brahmajit Das <listout@listout.xyz>
Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-btrfs@vger.kernel.org, clm@fb.com, josef@toxicpanda.com,
dsterba@suse.com, kees@kernel.org, ailiop@suse.com,
mark@harmstone.com, David Sterba <dsterba@suse.cz>,
Brahmajit Das <bdas@suse.de>
Subject: Re: [PATCH v4] btrfs: replace deprecated strcpy with strscpy
Date: Tue, 1 Jul 2025 16:55:51 +0200 [thread overview]
Message-ID: <20250701145551.GS31241@twin.jikos.cz> (raw)
In-Reply-To: <20250620164957.14922-1-listout@listout.xyz>
On Fri, Jun 20, 2025 at 10:19:57PM +0530, Brahmajit Das wrote:
> strcpy is deprecated due to lack of bounds checking. This patch replaces
> strcpy with strscpy, the recommended alternative for null terminated
> strings, to follow best practices.
>
> There are instances where strscpy cannot be used such as where both the
> source and destination are character pointers. In that instance we can
> use sysfs_emit.
>
> Link: https://github.com/KSPP/linux/issues/88
> Suggested-by: Anthony Iliopoulos <ailiop@suse.com>
> Suggested-by: David Sterba <dsterba@suse.cz>
> Signed-off-by: Brahmajit Das <bdas@suse.de>
> ---
>
> Changes in v2: using sysfs_emit instead of scnprintf.
> Changes in v3: Removed string.h in xattr, since we are not using any.
> fucntions from string.h and fixed length in memcpy in volumes.c
> Changes in v4: As suggested by David, moving "NONE" as initial value of
> buf in describe_relocation() and removed copying of "NONE" to bp in
> btrfs_describe_block_groups().
Sorry for the delay, added to for-next. Thanks.
next prev parent reply other threads:[~2025-07-01 14:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 16:49 [PATCH v4] btrfs: replace deprecated strcpy with strscpy Brahmajit Das
2025-07-01 14:55 ` David Sterba [this message]
2025-07-02 18:27 ` Nathan Chancellor
2025-07-02 20:46 ` Brahmajit Das
2025-07-03 0:38 ` Brahmajit Das
2025-07-03 15:12 ` David Sterba
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=20250701145551.GS31241@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=ailiop@suse.com \
--cc=bdas@suse.de \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=kees@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=listout@listout.xyz \
--cc=mark@harmstone.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