[lvc-project] [PATCH v2] btrfs: rcu_string: Replace strncpy() with strscpy()

David Sterba dsterba at suse.cz
Mon Nov 21 21:54:27 MSK 2022


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 at red-soft.ru>

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.



More information about the lvc-project mailing list