Commit 8ac1d397 authored by Dan Carpenter's avatar Dan Carpenter Committed by Pengyuan Zhao
Browse files

vhost-vdpa: return -EFAULT on copy_to_user() failure

mainline inclusion
from mainline-v5.19-rc1
commit f4a8686e
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4a8686ec7a34f940d36784872036fbacb1b4623



----------------------------------------------------------------------

The copy_to_user() function returns the number of bytes remaining to be
copied.  However, we need to return a negative error code, -EFAULT, to
the user.

Fixes: 87f4c217413a ("vhost-vdpa: introduce uAPI to get the number of virtqueue groups")
Fixes: e96ef636f154 ("vhost-vdpa: introduce uAPI to get the number of address spaces")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Message-Id: <YotG1vXKXXSayr63@kili>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarPengyuan Zhao <zhaopengyuan@hisilicon.com>
parent 2abe35ac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment