Re: [PATCH v3] btrfs: Replace strncpy() with strscpy()

From: David Sterba
Date: Tue Nov 22 2022 - 10:52:58 EST


On Tue, Nov 22, 2022 at 05:51:08PM +0300, Artem Chernyshev wrote:
> Using strncpy() on NUL-terminated strings are deprecated.
> To avoid possible forming of non-terminated string
> strscpy() could be used.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 475f63874d73 ("btrfs: new ioctls for scrub")
> Fixes: 606686eeac45 ("Btrfs: use rcu to protect device->name")
> Signed-off-by: Artem Chernyshev <artem.chernyshev@xxxxxxxxxxx>

Added to misc-next with minor adjustments, thanks.