[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37cea83e-06b2-44c6-abe2-4bccc1cfd5c4@harmstone.com>
Date: Fri, 20 Jun 2025 06:15:34 +0100
From: Mark Harmstone <mark@...mstone.com>
To: Brahmajit Das <listout@...tout.xyz>, linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org
Cc: clm@...com, josef@...icpanda.com, dsterba@...e.com, kees@...nel.org,
ailiop@...e.com
Subject: Re: [PATCH v3] btrfs: replace deprecated strcpy with strscpy
On 20/06/2025 2.43 am, Brahmajit Das wrote:
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -215,7 +215,7 @@ void btrfs_describe_block_groups(u64 bg_flags, char *buf, u32 size_buf)
> u32 size_bp = size_buf;
>
> if (!flags) {
> - strcpy(bp, "NONE");
> + memcpy(bp, "NONE", 5);
> return;
> }
There's still the problem here that you're hardcoding a magic number,
and that memcpy is no safer than strcpy.
If your aim is to get rid of strcpy entirely in the codebase, this is
more than likely impossible.
Powered by blists - more mailing lists