1 From e4bde707b4972a03ffc7737bb8e70eed830670ca Mon Sep 17 00:00:00 2001
2 From: Alan Coopersmith <alan.coopersmith@oracle.com>
3 Date: Sun, 26 Jan 2014 19:33:34 -0800
4 Subject: [PATCH 12/33] present: unvalidated lengths in Present extension
5 procs [CVE-2014-8103 2/2]
7 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
8 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 Reviewed-by: Julien Cristau <jcristau@debian.org>
11 present/present_request.c | 6 ++++++
12 1 file changed, 6 insertions(+)
14 diff --git a/present/present_request.c b/present/present_request.c
15 index 835890d..7c53e72 100644
16 --- a/present/present_request.c
17 +++ b/present/present_request.c
18 @@ -210,6 +210,7 @@ proc_present_query_capabilities (ClientPtr client)
19 RRCrtcPtr crtc = NULL;
22 + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq);
23 r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess);
26 @@ -254,6 +255,7 @@ static int
27 sproc_present_query_version(ClientPtr client)
29 REQUEST(xPresentQueryVersionReq);
30 + REQUEST_SIZE_MATCH(xPresentQueryVersionReq);
32 swaps(&stuff->length);
33 swapl(&stuff->majorVersion);
34 @@ -265,6 +267,7 @@ static int
35 sproc_present_pixmap(ClientPtr client)
37 REQUEST(xPresentPixmapReq);
38 + REQUEST_AT_LEAST_SIZE(xPresentPixmapReq);
40 swaps(&stuff->length);
41 swapl(&stuff->window);
42 @@ -284,6 +287,7 @@ static int
43 sproc_present_notify_msc(ClientPtr client)
45 REQUEST(xPresentNotifyMSCReq);
46 + REQUEST_SIZE_MATCH(xPresentNotifyMSCReq);
48 swaps(&stuff->length);
49 swapl(&stuff->window);
50 @@ -297,6 +301,7 @@ static int
51 sproc_present_select_input (ClientPtr client)
53 REQUEST(xPresentSelectInputReq);
54 + REQUEST_SIZE_MATCH(xPresentSelectInputReq);
56 swaps(&stuff->length);
57 swapl(&stuff->window);
58 @@ -308,6 +313,7 @@ static int
59 sproc_present_query_capabilities (ClientPtr client)
61 REQUEST(xPresentQueryCapabilitiesReq);
62 + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq);
63 swaps(&stuff->length);
64 swapl(&stuff->target);
65 return (*proc_present_vector[stuff->presentReqType]) (client);