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

From: David Sterba
Date: Mon Nov 21 2022 - 13:55:04 EST


On Sat, Nov 19, 2022 at 11:13:29AM +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: 606686eeac45 ("Btrfs: use rcu to protect device->name")
> Signed-off-by: Artem Chernyshev <artem.chernyshev@xxxxxxxxxxx>

Added to misc-next, thanks. There's one last strncpy in
btrfs_ioctl_dev_info if you also want to convert it. The rest is strcpy
from static strings.