Skip to content

Commit

Permalink
next: drm/atomic: Use copy_from_user to copy 64 bit data from user space
Browse files Browse the repository at this point in the history
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: d34f20d ("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>
  • Loading branch information
Guenter Roeck authored and Daniel Vetter committed Jan 21, 2015
1 parent cdd1cf7 commit 42c5814
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,9 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
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;
}
Expand Down

0 comments on commit 42c5814

Please sign in to comment.