summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/r300_cmdbuf.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-05-13 09:00:51 +0400
committerDave Airlie <airlied@redhat.com>2013-05-13 09:23:34 +0400
commitfefaedcfb82d2e57c2320acf60604ab03b750cc0 (patch)
tree527eeb56d4848a594c027750459636606c1c67e7 /drivers/gpu/drm/radeon/r300_cmdbuf.c
parent9f1d036648c1c5ed81b0e98d7a06d55df972701e (diff)
downloadlinux-fefaedcfb82d2e57c2320acf60604ab03b750cc0.tar.xz
drm/radeon: check incoming cliprects pointer
The "boxes" parameter points into userspace memory. It should be verified like any other operation against user memory. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300_cmdbuf.c')
-rw-r--r--drivers/gpu/drm/radeon/r300_cmdbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c
index 865e2c9980db..60170ea5e3a2 100644
--- a/drivers/gpu/drm/radeon/r300_cmdbuf.c
+++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c
@@ -75,7 +75,7 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
OUT_RING(CP_PACKET0(R300_RE_CLIPRECT_TL_0, nr * 2 - 1));
for (i = 0; i < nr; ++i) {
- if (DRM_COPY_FROM_USER_UNCHECKED
+ if (DRM_COPY_FROM_USER
(&box, &cmdbuf->boxes[n + i], sizeof(box))) {
DRM_ERROR("copy cliprect faulted\n");
return -EFAULT;