From: Guenter Roeck <linux@roeck-us•net>
To: David Airlie <airlied@linux•ie>
Cc: dri-devel@lists•freedesktop.org, linux-kernel@vger•kernel.org,
linux-next@vger•kernel.org, Guenter Roeck <linux@roeck-us•net>,
Rob Clark <robdclark@gmail•com>
Subject: [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data from user space
Date: Mon, 12 Jan 2015 21:12:17 -0800 [thread overview]
Message-ID: <1421125937-27394-1-git-send-email-linux@roeck-us.net> (raw)
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
next reply other threads:[~2015-01-13 5:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 5:12 Guenter Roeck [this message]
2015-01-14 19:46 ` [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data from user space Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421125937-27394-1-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us$(echo .)net \
--cc=airlied@linux$(echo .)ie \
--cc=dri-devel@lists$(echo .)freedesktop.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=robdclark@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox