drm/i915/gvt: throw error on unhandled vfio ioctls
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Mar 2018 14:08:47 +0000 (15:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:02 +0000 (11:02 +0200)
commit 9f591ae60e1be026901398ef99eede91237aa3a1 upstream.

On unknown/unhandled ioctls the driver should return an error, so
userspace knows it tried to use something unsupported.

Cc: stable@vger.kernel.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/gvt/kvmgt.c

index 83e88c70272a5b0dd3b60134c83b44752dbd1a48..9bf4045cd679ab6598494e13440e3b4f23d60c78 100644 (file)
@@ -1153,7 +1153,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
                return 0;
        }
 
-       return 0;
+       return -ENOTTY;
 }
 
 static ssize_t