]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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 15:34:29 +0000 (16:34 +0100)
commit87515f38983d913cf196f0fadf2bef7f9dd4f84e
tree873e14606002f17ef587ad4f0158720677989ba7
parentf5e60f4b4eebc34382664e8c8287bd81b5a27b5b
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