Commit 82d7279e authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Mike Gabriel

dix: integer overflow in REQUEST_FIXED_SIZE() [CVE-2014-8092 4/4]

Force use of 64-bit integers when evaluating data provided by clients in 32-bit fields which can overflow when added or multiplied during checks. Reported-by: 's avatarIlja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net> RHEL5: add #include <stdint.h> for uint64_t v3: backport to nx-libs 3.6.x (Mike DePaulo)
parent ed1e13a1
......@@ -50,6 +50,8 @@ SOFTWARE.
#ifndef DIX_H
#define DIX_H
#include <stdint.h>
#include "gc.h"
#include "window.h"
#include "input.h"
......@@ -73,7 +75,8 @@ SOFTWARE.
#define REQUEST_FIXED_SIZE(req, n)\
if (((sizeof(req) >> 2) > client->req_len) || \
(((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
((n >> 2) >= client->req_len) || \
((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
return(BadLength)
#define LEGAL_NEW_RESOURCE(id,client)\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment