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 | ||
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; | |
20 | int r; | |
21 | ||
22 | + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); | |
23 | r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess); | |
24 | switch (r) { | |
25 | case Success: | |
26 | @@ -254,6 +255,7 @@ static int | |
27 | sproc_present_query_version(ClientPtr client) | |
28 | { | |
29 | REQUEST(xPresentQueryVersionReq); | |
30 | + REQUEST_SIZE_MATCH(xPresentQueryVersionReq); | |
31 | ||
32 | swaps(&stuff->length); | |
33 | swapl(&stuff->majorVersion); | |
34 | @@ -265,6 +267,7 @@ static int | |
35 | sproc_present_pixmap(ClientPtr client) | |
36 | { | |
37 | REQUEST(xPresentPixmapReq); | |
38 | + REQUEST_AT_LEAST_SIZE(xPresentPixmapReq); | |
39 | ||
40 | swaps(&stuff->length); | |
41 | swapl(&stuff->window); | |
42 | @@ -284,6 +287,7 @@ static int | |
43 | sproc_present_notify_msc(ClientPtr client) | |
44 | { | |
45 | REQUEST(xPresentNotifyMSCReq); | |
46 | + REQUEST_SIZE_MATCH(xPresentNotifyMSCReq); | |
47 | ||
48 | swaps(&stuff->length); | |
49 | swapl(&stuff->window); | |
50 | @@ -297,6 +301,7 @@ static int | |
51 | sproc_present_select_input (ClientPtr client) | |
52 | { | |
53 | REQUEST(xPresentSelectInputReq); | |
54 | + REQUEST_SIZE_MATCH(xPresentSelectInputReq); | |
55 | ||
56 | swaps(&stuff->length); | |
57 | swapl(&stuff->window); | |
58 | @@ -308,6 +313,7 @@ static int | |
59 | sproc_present_query_capabilities (ClientPtr client) | |
60 | { | |
61 | REQUEST(xPresentQueryCapabilitiesReq); | |
62 | + REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq); | |
63 | swaps(&stuff->length); | |
64 | swapl(&stuff->target); | |
65 | return (*proc_present_vector[stuff->presentReqType]) (client); | |
66 | -- | |
67 | 1.7.9.2 | |
68 |