Skip to content
Snippets Groups Projects
Commit ac15d4ce authored by Tobias Stoeckmann's avatar Tobias Stoeckmann Committed by Adam Jackson
Browse files

render: Fix out of boundary heap access


ProcRenderCreateRadialGradient and ProcRenderCreateConicalGradient must
be protected against an integer overflow during length check. This is
already included in ProcRenderCreateLinearGradient since the fix for
CVE-2008-2362.

This can only be successfully exploited on a 32 bit system for an
out of boundary read later on. Validated by using ASAN.

Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 0c1574d9
No related branches found
No related tags found
No related merge requests found
...@@ -1908,6 +1908,8 @@ ProcRenderCreateRadialGradient(ClientPtr client) ...@@ -1908,6 +1908,8 @@ ProcRenderCreateRadialGradient(ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor)))
return BadLength;
if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor)))
return BadLength; return BadLength;
...@@ -1946,6 +1948,8 @@ ProcRenderCreateConicalGradient(ClientPtr client) ...@@ -1946,6 +1948,8 @@ ProcRenderCreateConicalGradient(ClientPtr client)
LEGAL_NEW_RESOURCE(stuff->pid, client); LEGAL_NEW_RESOURCE(stuff->pid, client);
len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
if (stuff->nStops > UINT32_MAX / (sizeof(xFixed) + sizeof(xRenderColor)))
return BadLength;
if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor))) if (len != stuff->nStops * (sizeof(xFixed) + sizeof(xRenderColor)))
return BadLength; return BadLength;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment