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]
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>
14 glx/glxcmdsswap.c | 4 ++++
15 1 file changed, 4 insertions(+)
17 diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
18 index 5d179f3..9ec1222 100644
19 --- a/glx/glxcmdsswap.c
20 +++ b/glx/glxcmdsswap.c
21 @@ -958,11 +958,13 @@ __glXDispSwap_RenderLarge(__GLXclientState * cl, GLbyte * pc)
23 __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
25 + ClientPtr client = cl->client;
26 xGLXVendorPrivateReq *req;
28 __GLXdispatchVendorPrivProcPtr proc;
30 __GLX_DECLARE_SWAP_VARIABLES;
31 + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
33 req = (xGLXVendorPrivateReq *) pc;
34 __GLX_SWAP_SHORT(&req->length);
35 @@ -985,11 +987,13 @@ __glXDispSwap_VendorPrivate(__GLXclientState * cl, GLbyte * pc)
37 __glXDispSwap_VendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
39 + ClientPtr client = cl->client;
40 xGLXVendorPrivateWithReplyReq *req;
42 __GLXdispatchVendorPrivProcPtr proc;
44 __GLX_DECLARE_SWAP_VARIABLES;
45 + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq);
47 req = (xGLXVendorPrivateWithReplyReq *) pc;
48 __GLX_SWAP_SHORT(&req->length);