This is a note to let you know that I've just added the patch titled s390/crypto: return -EFAULT if copy_to_user() fails to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-crypto-return-efault-if-copy_to_user-fails.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 942df4be7ab40195e2a839e9de81951a5862bc5b Mon Sep 17 00:00:00 2001 From: Wang Qing <wangqing@xxxxxxxx> Date: Mon, 1 Mar 2021 20:08:21 +0800 Subject: s390/crypto: return -EFAULT if copy_to_user() fails From: Wang Qing <wangqing@xxxxxxxx> commit 942df4be7ab40195e2a839e9de81951a5862bc5b 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: e06670c5fe3b ("s390: vfio-ap: implement VFIO_DEVICE_GET_INFO ioctl") Signed-off-by: Wang Qing <wangqing@xxxxxxxx> Reviewed-by: Tony Krowiak <akrowiak@xxxxxxxxxxxxx> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/1614600502-16714-1-git-send-email-wangqing@xxxxxxxx Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/s390/crypto/vfio_ap_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -1279,7 +1279,7 @@ static int vfio_ap_mdev_get_device_info( info.num_regions = 0; info.num_irqs = 0; - return copy_to_user((void __user *)arg, &info, minsz); + return copy_to_user((void __user *)arg, &info, minsz) ? -EFAULT : 0; } static ssize_t vfio_ap_mdev_ioctl(struct mdev_device *mdev, Patches currently in stable-queue which might be from wangqing@xxxxxxxx are queue-5.10/s390-crypto-return-efault-if-copy_to_user-fails.patch queue-5.10/s390-cio-return-efault-if-copy_to_user-fails.patch