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>
This commit is contained in:
Alan Coopersmith 2014-01-22 23:40:18 -08:00
parent e0e1164462
commit 6692670fde

View File

@ -270,6 +270,9 @@ ProcDRI2GetBuffers(ClientPtr client)
unsigned int *attachments; unsigned int *attachments;
REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4);
if (stuff->count > (INT_MAX / 4))
return BadLength;
if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
&pDrawable, &status)) &pDrawable, &status))
return status; return status;