next: drm/atomic: Use copy_from_user to copy 64 bit data from user space
authorGuenter Roeck <linux@roeck-us.net>
Tue, 13 Jan 2015 05:12:17 +0000 (21:12 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 21 Jan 2015 13:57:04 +0000 (14:57 +0100)
Copying 64 bit data from user space using get_user is not supported
on all architectures, and may result in the following build error.

ERROR: "__get_user_bad" [drivers/gpu/drm/drm.ko] undefined!

Avoid the problem by using copy_from_user.

Fixes: d34f20d6e2f2 ("drm: Atomic modeset ioctl")
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic.c

index 1e38dfc8e462fde168de1d8316ff237a8e4f8568..af3f3dfdb49f2b0fe0811fa88d4f5daf6bf0d3d9 100644 (file)
@@ -1259,7 +1259,9 @@ retry:
                                goto fail;
                        }
 
-                       if (get_user(prop_value, prop_values_ptr + copied_props)) {
+                       if (copy_from_user(&prop_value,
+                                          prop_values_ptr + copied_props,
+                                          sizeof(prop_value))) {
                                ret = -EFAULT;
                                goto fail;
                        }