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