mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data from user space
@ 2015-01-13  5:12 Guenter Roeck
  2015-01-14 19:46 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2015-01-13  5:12 UTC (permalink / raw)
  To: David Airlie
  Cc: dri-devel, linux-kernel, linux-next, Guenter Roeck, Rob Clark

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>
---
Compile tested only.

 drivers/gpu/drm/drm_atomic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 1e38dfc..af3f3df 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -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;
 			}
-- 
2.1.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-14 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-13  5:12 [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data from user space Guenter Roeck
2015-01-14 19:46 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®