xserver-multidpi/dix
Alan Coopersmith 73b2660d72 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@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-10-14 17:56:44 -07:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
atom.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
buildatoms XFree86 4.3.0.1 2003-11-14 16:49:22 +00:00
BuiltInAtoms R6.6 is the Xorg base-line 2003-11-14 15:54:54 +00:00
colormap.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
cursor.c dix: FIXES is not optional 2013-09-10 13:28:24 -04:00
devices.c Merge remote-tracking branch 'whot/unreviewed' 2013-05-23 19:58:46 -06:00
dispatch.c dix: Remove a dead parameter from DoGetImage 2013-09-10 13:28:23 -04:00
dispatch.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dixfonts.c Avoid use-after-free in dix/dixfonts.c: doImageText() [CVE-2013-4396] 2013-10-14 17:56:44 -07:00
dixutils.c dix: delete all callbacks before reset 2013-05-08 09:27:30 +10:00
enterleave.c input: drop FP1616 macro 2012-11-19 12:12:23 +10:00
enterleave.h dix: Move DeviceFocusEvent from Xi into enterleave.c 2012-05-17 08:50:44 +10:00
eventconvert.c dix: send the current axis value in DeviceChangedEvents (#62321) 2013-05-07 09:40:42 +10:00
events.c dix: only deliver for the current grab type 2013-10-14 11:07:38 +10:00
extension.c Use C99 designated initializers in dix Replies 2012-07-09 19:58:29 -07:00
ffs.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
gc.c Fix up formatting of initializers for arrays of structs 2012-08-06 15:22:53 -07:00
getevents.c dix: set the valuator mask to ensure XI 1.x events have data 2013-07-25 12:57:41 +10:00
globals.c os: Add -displayfd option 2012-05-01 11:36:30 +10:00
glyphcurs.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabs.c Abstract cursor refcounting 2013-05-15 19:17:57 +10:00
initatoms.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
inpututils.c input: calloc minimization for xi2mask_new 2013-10-14 11:07:37 +10:00
main.c Allow DDX to provide a main() 2013-07-23 23:56:58 +01:00
Makefile.am Allow DDX to provide a main() 2013-07-23 23:56:58 +01:00
pixmap.c damage: Implicitly unregister on destroy 2013-09-10 14:28:09 -04:00
privates.c dbe: Fold the window private private into the window private 2013-09-10 13:28:24 -04:00
property.c Use C99 designated initializers in dix Events 2012-07-09 22:52:30 -07:00
protocol.txt Add DRI2 requests to protocol.txt 2009-08-28 23:29:05 -04:00
ptrveloc.c dix: allow a ConstantDeceleration between 0 and 1 (#66134) 2013-07-17 14:27:26 +10:00
region.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
registry.c dix: reset the registry before quitting 2013-05-07 09:41:02 +10:00
resource.c dix: add reference count of the resource to ResourceSizeRec 2012-04-18 12:49:11 +03:00
selection.c Use C99 designated initializers in dix Events 2012-07-09 22:52:30 -07:00
stubmain.c Allow DDX to provide a main() 2013-07-23 23:56:58 +01:00
swaprep.c Remove unneccesary casts from WriteToClient calls 2012-07-09 19:12:56 -07:00
swapreq.c Use C99 designated initializers in dix Events 2012-07-09 22:52:30 -07:00
tables.c Make indentation of dix/tables.c much more consistent and readable 2012-08-06 15:22:53 -07:00
touch.c dix: check the xi2mask, not the grab type for touch listeners 2013-07-24 11:50:00 +10:00
window.c dix: FIXES is not optional 2013-09-10 13:28:24 -04:00
Xserver-dtrace.h.in dix: add dtrace probes to input API 2012-03-22 11:33:42 +10:00
Xserver.d dix: add dtrace probes to input API 2012-03-22 11:33:42 +10:00