xserver-multidpi/dix
Andrew Eikum 78e508c937 dix: Clear any existing selections before initializing privates
If there is a selection left over from a previous execution of the
main loop, and that selection has privates allocated for it, the X
server will crash. This is because dixResetPrivates() resets the
privates refcounts to zero without accounting for the reference held
by the selection object. When the selection is then deleted in
InitSelections() after the call to dixResetPrivates(), the refcount
for its privates type goes negative and bad things happen.

To fix this, we should delete any existing selections before calling
dixResetPrivates(). This will properly release the selection's
privates and avoid the crash.

A more thorough description of the problem and a test case to
reproduce the crash is available at a previous mail:
  "Negative Selection devPrivates refcount?"
  By Andrew Eikum to xorg-devel on 10 Dec 2013
  http://lists.freedesktop.org/archives/xorg-devel/2013-December/039492.html

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-03-06 17:15:11 -08: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 Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
cursor.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
devices.c dix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS 2014-02-04 11:38:00 +10:00
dispatch.c dix: fix a -Wshadow warning 2014-02-05 15:10:27 +10:00
dispatch.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dixfonts.c On realloc failure, free font_path_string instead of leaking it 2014-01-29 15:22:19 -08:00
dixutils.c Clean up a few function prototypes to not place formals in /**/ 2014-01-12 10:24:12 -08: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 Merge remote-tracking branch 'whot/for-keith' 2014-01-22 11:33:53 -08:00
extension.c Clean up warnings in DIX 2014-01-12 10:14:49 -08:00
ffs.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
gc.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
getevents.c dix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS 2014-02-04 11:38:00 +10:00
globals.c Clean up warnings in DIX 2014-01-12 10:14:49 -08:00
glyphcurs.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
grabs.c Merge remote-tracking branch 'whot/for-keith' 2014-01-22 11:33:53 -08:00
initatoms.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
inpututils.c dix: fix button state check before changing a button mapping 2014-02-05 07:50:16 +10:00
main.c dix: Clear any existing selections before initializing privates 2014-03-06 17:15:11 -08:00
Makefile.am Allow DDX to provide a main() 2013-07-23 23:56:58 +01:00
pixmap.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
privates.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
property.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
protocol.txt Add RANDR 1.4 requests & events to dix/protocol.txt 2014-01-29 15:22:44 -08:00
ptrveloc.c dix: allow a ConstantDeceleration between 0 and 1 (#66134) 2013-07-17 14:27:26 +10:00
region.c Add a RegionDuplicate function 2013-10-31 16:58:16 -07:00
registry.c dix: reset the registry before quitting 2013-05-07 09:41:02 +10:00
resource.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08: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 Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
window.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08: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