Blame SOURCES/0005-dix-integer-overflow-in-REQUEST_FIXED_SIZE-CVE-2014-.patch

0fd959
From 0e80157d06ab07ac4535448f84eec94c52716bb4 Mon Sep 17 00:00:00 2001
0fd959
From: Alan Coopersmith <alan.coopersmith@oracle.com>
0fd959
Date: Wed, 22 Jan 2014 23:44:46 -0800
0fd959
Subject: [PATCH 05/33] dix: integer overflow in REQUEST_FIXED_SIZE()
0fd959
 [CVE-2014-8092 4/4]
0fd959
0fd959
Force use of 64-bit integers when evaluating data provided by clients
0fd959
in 32-bit fields which can overflow when added or multiplied during
0fd959
checks.
0fd959
0fd959
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
0fd959
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
0fd959
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
0fd959
Signed-off-by: Fedora X Ninjas <x@fedoraproject.org>
0fd959
---
0fd959
 include/dix.h | 3 ++-
0fd959
 1 file changed, 2 insertions(+), 1 deletion(-)
0fd959
0fd959
diff --git a/include/dix.h b/include/dix.h
0fd959
index fa7ccd4..7c36932 100644
0fd959
--- a/include/dix.h
0fd959
+++ b/include/dix.h
0fd959
@@ -76,7 +76,8 @@ SOFTWARE.
0fd959
 
0fd959
 #define REQUEST_FIXED_SIZE(req, n)\
0fd959
     if (((sizeof(req) >> 2) > client->req_len) || \
0fd959
-        (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
0fd959
+        ((n >> 2) >= client->req_len) || \
0fd959
+        ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len))  \
0fd959
          return(BadLength)
0fd959
 
0fd959
 #define LEGAL_NEW_RESOURCE(id,client)\
0fd959
-- 
0fd959
1.9.3
0fd959