Commit | Line | Data |
---|---|---|
7217e0ca ML |
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] | |
6 | ||
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> | |
10 | --- | |
11 | present/present_request.c | 6 ++++++ | |
12 | 1 file changed, 6 insertions(+) | |
13 | ||
7217e0ca ML |
14 | --- a/present/present_request.c |
15 | +++ b/present/present_request.c | |
4db25562 | 16 | @@ -210,6 +210,7 @@ proc_present_query_capabilities (ClientP |
7217e0ca ML |
17 | RRCrtcPtr crtc = NULL; |
18 | int r; | |
19 | ||
20 | + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); | |
21 | r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess); | |
22 | switch (r) { | |
23 | case Success: | |
24 | @@ -254,6 +255,7 @@ static int | |
25 | sproc_present_query_version(ClientPtr client) | |
26 | { | |
27 | REQUEST(xPresentQueryVersionReq); | |
28 | + REQUEST_SIZE_MATCH(xPresentQueryVersionReq); | |
29 | ||
30 | swaps(&stuff->length); | |
31 | swapl(&stuff->majorVersion); | |
32 | @@ -265,6 +267,7 @@ static int | |
33 | sproc_present_pixmap(ClientPtr client) | |
34 | { | |
35 | REQUEST(xPresentPixmapReq); | |
36 | + REQUEST_AT_LEAST_SIZE(xPresentPixmapReq); | |
37 | ||
38 | swaps(&stuff->length); | |
39 | swapl(&stuff->window); | |
40 | @@ -284,6 +287,7 @@ static int | |
41 | sproc_present_notify_msc(ClientPtr client) | |
42 | { | |
43 | REQUEST(xPresentNotifyMSCReq); | |
44 | + REQUEST_SIZE_MATCH(xPresentNotifyMSCReq); | |
45 | ||
46 | swaps(&stuff->length); | |
47 | swapl(&stuff->window); | |
48 | @@ -297,6 +301,7 @@ static int | |
49 | sproc_present_select_input (ClientPtr client) | |
50 | { | |
51 | REQUEST(xPresentSelectInputReq); | |
52 | + REQUEST_SIZE_MATCH(xPresentSelectInputReq); | |
53 | ||
54 | swaps(&stuff->length); | |
55 | swapl(&stuff->window); | |
56 | @@ -308,6 +313,7 @@ static int | |
57 | sproc_present_query_capabilities (ClientPtr client) | |
58 | { | |
59 | REQUEST(xPresentQueryCapabilitiesReq); | |
60 | + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); | |
61 | swaps(&stuff->length); | |
62 | swapl(&stuff->target); | |
63 | return (*proc_present_vector[stuff->presentReqType]) (client); |