]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/radeon/kms: add missing copy from user
authorDr. David Alan Gilbert <linux@treblig.org>
Sun, 1 Aug 2010 23:43:52 +0000 (09:43 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:45:51 +0000 (16:45 -0700)
commit d8ab35575098b2d6dc10b2535aeb40545933ae56 upstream.

This hasn't mattered up until the ioctl started using the value, and it fell
apart.

fixes fd.o 29340, Ubuntu LP 606081

[airlied: cleaned up whitespace and don't need an error before pushing]

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/radeon/radeon_kms.c

index ab389f89fa8df7fca6af0a3ca9197c0102dc39f4..b20379e04a9c25727fe46b36fc438fc2fe68f28b 100644 (file)
@@ -106,7 +106,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 
        info = data;
        value_ptr = (uint32_t *)((unsigned long)info->value);
-       value = *value_ptr;
+       if (DRM_COPY_FROM_USER(&value, value_ptr, sizeof(value)))
+               return -EFAULT;
+
        switch (info->request) {
        case RADEON_INFO_DEVICE_ID:
                value = dev->pci_device;