summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-05-13 07:00:51 +0200
committerDave Airlie <airlied@redhat.com>2013-05-13 07:23:34 +0200
commitfefaedcfb82d2e57c2320acf60604ab03b750cc0 (patch)
tree527eeb56d4848a594c027750459636606c1c67e7 /drivers
parentdrm/mgag200: Fix framebuffer base address programming (diff)
downloadlinux-fefaedcfb82d2e57c2320acf60604ab03b750cc0.tar.xz
linux-fefaedcfb82d2e57c2320acf60604ab03b750cc0.zip
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')
-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;