Commit | Line | Data |
---|---|---|
7217e0ca ML |
1 | From efb3efd096edba7551e4e0e40bea522651211303 Mon Sep 17 00:00:00 2001 |
2 | From: Adam Jackson <ajax@redhat.com> | |
3 | Date: Mon, 10 Nov 2014 12:13:44 -0500 | |
4 | Subject: [PATCH 28/33] glx: Top-level length checking for swapped | |
5 | VendorPrivate requests [CVE-2014-8098 4/8] | |
6 | ||
7 | Reviewed-by: Keith Packard <keithp@keithp.com> | |
8 | Reviewed-by: Julien Cristau <jcristau@debian.org> | |
9 | Reviewed-by: Michal Srb <msrb@suse.com> | |
10 | Reviewed-by: Andy Ritger <aritger@nvidia.com> | |
11 | Signed-off-by: Adam Jackson <ajax@redhat.com> | |
12 | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> | |
13 | --- | |
14 | glx/glxcmdsswap.c | 4 ++++ | |
15 | 1 file changed, 4 insertions(+) | |
16 | ||
7217e0ca ML |
17 | --- a/glx/glxcmdsswap.c |
18 | +++ b/glx/glxcmdsswap.c | |
4db25562 | 19 | @@ -958,11 +958,13 @@ __glXDispSwap_RenderLarge(__GLXclientSta |
7217e0ca ML |
20 | int |
21 | __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc) | |
22 | { | |
23 | + ClientPtr client = cl->client; | |
24 | xGLXVendorPrivateReq *req; | |
25 | GLint vendorcode; | |
26 | __GLXdispatchVendorPrivProcPtr proc; | |
27 | ||
28 | __GLX_DECLARE_SWAP_VARIABLES; | |
29 | + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); | |
30 | ||
31 | req = (xGLXVendorPrivateReq *) pc; | |
32 | __GLX_SWAP_SHORT(&req->length); | |
4db25562 | 33 | @@ -985,11 +987,13 @@ __glXDispSwap_VendorPrivate(__GLXclientS |
7217e0ca ML |
34 | int |
35 | __glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc) | |
36 | { | |
37 | + ClientPtr client = cl->client; | |
38 | xGLXVendorPrivateWithReplyReq *req; | |
39 | GLint vendorcode; | |
40 | __GLXdispatchVendorPrivProcPtr proc; | |
41 | ||
42 | __GLX_DECLARE_SWAP_VARIABLES; | |
43 | + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq); | |
44 | ||
45 | req = (xGLXVendorPrivateWithReplyReq *) pc; | |
46 | __GLX_SWAP_SHORT(&req->length); |