diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-22 23:40:18 -0800 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2014-12-09 17:50:12 +0100 |
commit | db386cd6a1ccf62d3be9fc88994d48ef9f8375cf (patch) | |
tree | abe114432b8f3f4e8958813c8c638da4c4c21a86 | |
parent | 2883994f9f2d5cae63816db6945dfea618e4a2ee (diff) |
dri2: integer overflow in ProcDRI2GetBuffers() [CVE-2014-8094]
ProcDRI2GetBuffers() tries to validate a length field (count).
There is an integer overflow in the validation. This can cause
out of bound reads and memory corruption later on.
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 6692670fde081bbfe9313f17d84037ae9116702a)
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | hw/xfree86/dri2/dri2ext.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index ffd66fad6..221ec530b 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -270,6 +270,9 @@ ProcDRI2GetBuffers(ClientPtr client) unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); + if (stuff->count > (INT_MAX / 4)) + return BadLength; + if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; |