[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKMK7uFbky9q5os_k8xu8vJE7vC0XMWPt9Q5ZDaqzSgd6Rh62Q@mail.gmail.com>
Date: Wed, 14 Jan 2015 20:46:16 +0100
From: Daniel Vetter <daniel@...ll.ch>
To: Guenter Roeck <linux@...ck-us.net>
Cc: David Airlie <airlied@...ux.ie>,
linux-next <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH] next: drm/atomic: Use copy_from_user to copy 64 bit data
from user space
On Mon, Jan 12, 2015 at 09:12:17PM -0800, Guenter Roeck wrote:
> 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@...il.com>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Merged into my drm misc branch, thanks.
-Daniel
> ---
> 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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists