xserver: Branch 'server-1.14-branch' - 2 commits
Matt Dew
marcoz at kemper.freedesktop.org
Mon Oct 21 19:45:36 PDT 2013
dix/dixfonts.c | 5 +++++
mi/miinitext.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 14276213ac4d59316d5745ccb9a2fb23eb10cf99
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Mon Aug 5 20:46:45 2013 -0700
Allow disabling XFree86-DGA, DRI, VidModeExtension extensions
Code to recognize these in extension enable/disable options was wrapped
in #ifdef XorgLoader, but that's not defined when building miinitext.c
since the great module merge of 1.13. Change to an #ifdef that is defined.
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Robert Hooker <robert.hooker at canonical.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 81c663a..dbca9f7 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -157,7 +157,7 @@ static ExtensionToggle ExtensionToggleList[] = {
#ifdef XF86BIGFONT
{"XFree86-Bigfont", &noXFree86BigfontExtension},
#endif
-#ifdef XorgLoader
+#ifdef XORGSERVER
#ifdef XFreeXDGA
{"XFree86-DGA", &noXFree86DGAExtension},
#endif
commit 296057914570bd319bce9b718e6b90f46e6cc661
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Mon Sep 16 21:47:16 2013 -0700
Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396]
Save a pointer to the passed in closure structure before copying it
and overwriting the *c pointer to point to our copy instead of the
original. If we hit an error, once we free(c), reset c to point to
the original structure before jumping to the cleanup code that
references *c.
Since one of the errors being checked for is whether the server was
able to malloc(c->nChars * itemSize), the client can potentially pass
a number of characters chosen to cause the malloc to fail and the
error path to be taken, resulting in the read from freed memory.
Since the memory is accessed almost immediately afterwards, and the
X server is mostly single threaded, the odds of the free memory having
invalid contents are low with most malloc implementations when not using
memory debugging features, but some allocators will definitely overwrite
the memory there, leading to a likely crash.
Reported-by: Pedro Ribeiro <pedrib at gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Julien Cristau <jcristau at debian.org>
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index feb765d..2e34d37 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1425,6 +1425,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
GC *pGC;
unsigned char *data;
ITclosurePtr new_closure;
+ ITclosurePtr old_closure;
/* We're putting the client to sleep. We need to
save some state. Similar problem to that handled
@@ -1436,12 +1437,14 @@ doImageText(ClientPtr client, ITclosurePtr c)
err = BadAlloc;
goto bail;
}
+ old_closure = c;
*new_closure = *c;
c = new_closure;
data = malloc(c->nChars * itemSize);
if (!data) {
free(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
@@ -1452,6 +1455,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
if (!pGC) {
free(c->data);
free(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
@@ -1464,6 +1468,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
FreeScratchGC(pGC);
free(c->data);
free(c);
+ c = old_closure;
err = BadAlloc;
goto bail;
}
More information about the xorg-commit
mailing list