[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <7144F578-88DC-46F3-926F-7652503149A6@linux.dev>
Date: Tue, 25 Feb 2025 13:58:50 +0100
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: dsterba@...e.cz
Cc: Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
linux-hardening@...r.kernel.org,
linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: Replace deprecated strncpy() with strscpy_pad()
On 25. Feb 2025, at 13:28, David Sterba wrote:
> On Tue, Feb 25, 2025 at 10:29:49AM +0100, Thorsten Blum wrote:
>> strncpy() is deprecated for NUL-terminated destination buffers. Use
>> strscpy_pad() instead and don't zero-initialize the param array.
>>
>> Compile-tested only.
>>
>> Link: https://github.com/KSPP/linux/issues/90
>> Cc: linux-hardening@...r.kernel.org
>> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
>> ---
>
> I don't think we need the padding, so strscpy is probably ok. We copy
> input string to a temporary modifiable buffer and then match it against
> a table, so the NUL termination is ok.
Ok thanks, I'll submit a v2 later today.
Powered by blists - more mailing lists