summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2021-11-02 11:08:19 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2021-11-02 11:08:19 +0100
commit7c594bbd2de9f03e7c8d808004045696bc9c1a67 (patch)
tree1533aa78209c12a7171359510de3844d944b5d4d /fs/fuse
parenta390ccb316beb8ea594b8695d53926710ca454a3 (diff)
downloadlinux-7c594bbd2de9f03e7c8d808004045696bc9c1a67.tar.bz2
virtiofs: use strscpy for copying the queue name
Always null terminate fsvq->name. Reported-by: kernel test robot <lkp@intel.com> Fixes: b43b7e81eb2b ("virtiofs: provide a helper function for virtqueue initialization") Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/virtio_fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 94fc874f5de7..4cfa4bc1f579 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -649,7 +649,7 @@ static void virtio_fs_vq_done(struct virtqueue *vq)
static void virtio_fs_init_vq(struct virtio_fs_vq *fsvq, char *name,
int vq_type)
{
- strncpy(fsvq->name, name, VQ_NAME_LEN);
+ strscpy(fsvq->name, name, VQ_NAME_LEN);
spin_lock_init(&fsvq->lock);
INIT_LIST_HEAD(&fsvq->queued_reqs);
INIT_LIST_HEAD(&fsvq->end_reqs);