X-Git-Url: https://git.piment-noir.org/?p=deb_xorg-server.git;a=blobdiff_plain;f=debian%2Fpatches%2FCVE-2014-8xxx%2F0003-dix-integer-overflow-in-GetHosts-CVE-2014-8092-2-4.patch;fp=debian%2Fpatches%2FCVE-2014-8xxx%2F0003-dix-integer-overflow-in-GetHosts-CVE-2014-8092-2-4.patch;h=d5f2d758a8c7ef56d8fcebf659b88aa8a8ecab9a;hp=0000000000000000000000000000000000000000;hb=7217e0ca50bba73dad94782e67980aeeb24ab693;hpb=a09e091a5c996d46a398abb27b06fe504591673f diff --git a/debian/patches/CVE-2014-8xxx/0003-dix-integer-overflow-in-GetHosts-CVE-2014-8092-2-4.patch b/debian/patches/CVE-2014-8xxx/0003-dix-integer-overflow-in-GetHosts-CVE-2014-8092-2-4.patch new file mode 100644 index 0000000..d5f2d75 --- /dev/null +++ b/debian/patches/CVE-2014-8xxx/0003-dix-integer-overflow-in-GetHosts-CVE-2014-8092-2-4.patch @@ -0,0 +1,47 @@ +From 2f605f86acec5ce853f764c41f8c737154a274f5 Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Mon, 6 Jan 2014 23:30:14 -0800 +Subject: [PATCH 03/33] dix: integer overflow in GetHosts() [CVE-2014-8092 + 2/4] + +GetHosts() iterates over all the hosts it has in memory, and copies +them to a buffer. The buffer length is calculated by iterating over +all the hosts and adding up all of their combined length. There is a +potential integer overflow, if there are lots and lots of hosts (with +a combined length of > ~4 gig). This should be possible by repeatedly +calling ProcChangeHosts() on 64bit machines with enough memory. + +This patch caps the list at 1mb, because multi-megabyte hostname +lists for X access control are insane. + +Reported-by: Ilja Van Sprundel +Signed-off-by: Alan Coopersmith +Reviewed-by: Peter Hutterer +--- + os/access.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: xorg-server-1.16.0/os/access.c +=================================================================== +--- xorg-server-1.16.0.orig/os/access.c 2014-12-04 11:11:43.752542885 -0500 ++++ xorg-server-1.16.0/os/access.c 2014-12-04 11:11:43.748542843 -0500 +@@ -1323,6 +1323,10 @@ + for (host = validhosts; host; host = host->next) { + nHosts++; + n += pad_to_int32(host->len) + sizeof(xHostEntry); ++ /* Could check for INT_MAX, but in reality having more than 1mb of ++ hostnames in the access list is ridiculous */ ++ if (n >= 1048576) ++ break; + } + if (n) { + *data = ptr = malloc(n); +@@ -1331,6 +1335,8 @@ + } + for (host = validhosts; host; host = host->next) { + len = host->len; ++ if ((ptr + sizeof(xHostEntry) + len) > (data + n)) ++ break; + ((xHostEntry *) ptr)->family = host->family; + ((xHostEntry *) ptr)->length = len; + ptr += sizeof(xHostEntry);