]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/cio: return -EFAULT if copy_to_user() fails
authorEric Farman <farman@linux.ibm.com>
Mon, 1 Mar 2021 18:33:24 +0000 (19:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 15:43:45 +0000 (16:43 +0100)
commit d9c48a948d29bcb22f4fe61a81b718ef6de561a0 upstream.

Fixes: 120e214e504f ("vfio: ccw: realize VFIO_DEVICE_G(S)ET_IRQ_INFO ioctls")
Signed-off-by: Eric Farman <farman@linux.ibm.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

index a7056c2322e01317a52eca8fba5698fe891eef8e..6873ab5fe57a83bb9d66f9665985bb0a1e670d90 100644 (file)
@@ -383,7 +383,7 @@ static ssize_t vfio_ccw_mdev_ioctl(struct mdev_device *mdev,
                if (info.count == -1)
                        return -EINVAL;
 
-               return copy_to_user((void __user *)arg, &info, minsz);
+               return copy_to_user((void __user *)arg, &info, minsz) ? -EFAULT : 0;
        }
        case VFIO_DEVICE_SET_IRQS:
        {