s390/cio: return -EFAULT if copy_to_user() fails again
authorWang Qing <wangqing@vivo.com>
Mon, 1 Mar 2021 12:01:33 +0000 (20:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:03:38 +0000 (17:03 +0100)
commitdfa176f374ba0fb9786b96f6883e6aa4f05b717c
tree39a1a47e5d61dbcdc2a3e9ae047a49e891042b38
parent05d11eb7bd9de13760f188c44c936853b48b16cf
s390/cio: return -EFAULT if copy_to_user() fails again

commit 51c44babdc19aaf882e1213325a0ba291573308f upstream.

The copy_to_user() function returns the number of bytes remaining to be
copied, but we want to return -EFAULT if the copy doesn't complete.

Fixes: e01bcdd61320 ("vfio: ccw: realize VFIO_DEVICE_GET_REGION_INFO ioctl")
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/1614600093-13992-1-git-send-email-wangqing@vivo.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/cio/vfio_ccw_ops.c