xserver-multidpi/Xi
Peter Hutterer d13cb97442 ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.

When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.

When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.

Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.

https://bugs.freedesktop.org/show_bug.cgi?id=97928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
..
allowev.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
allowev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgdctl.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
chgdctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgfctl.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
chgfctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgkbd.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgkbd.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgkmap.c Indentation: Change '& stuff' to '&stuff' 2012-03-21 14:02:30 -07:00
chgkmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgprop.c Indentation: Change '& stuff' to '&stuff' 2012-03-21 14:02:30 -07:00
chgprop.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgptr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgptr.h Xi: Remove redundant declaration. 2012-05-14 13:17:30 +01:00
closedev.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
closedev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
devbell.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
devbell.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
exevents.c Remove SIGIO support for input [v5] 2016-05-26 16:07:54 -07:00
exglobals.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
extinit.c dix: Remove pointless client-state callbacks 2016-05-11 11:21:08 -04:00
getbmap.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getbmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getdctl.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getdctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getfctl.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getfctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getfocus.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getfocus.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getkmap.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getkmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getmmap.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getmmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getprop.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
getprop.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getselev.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getselev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getvers.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
getvers.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdev.c Xi: Use 'void *' instead of 'Pointer' (which is going away) 2014-01-22 19:56:31 -08:00
grabdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdevb.c Use C99 designated initializers in extension Events 2012-07-09 22:52:30 -07:00
grabdevb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdevk.c Use C99 designated initializers in extension Events 2012-07-09 22:52:30 -07:00
grabdevk.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
gtmotion.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
gtmotion.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
listdev.c Xi: remove superfluous cast. 2014-02-04 10:53:59 +10:00
listdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
Makefile.am Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it 2014-03-27 14:09:43 +00:00
opendev.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
opendev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
queryst.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
queryst.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
selectev.c Indentation: Change '& stuff' to '&stuff' 2012-03-21 14:02:30 -07:00
selectev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
sendexev.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
sendexev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setbmap.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
setbmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setdval.c Xi: always return BadMatch for XTest devices ChangeDeviceControl requests 2013-05-07 09:40:44 +10:00
setdval.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setfocus.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setfocus.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setmmap.c Use C99 designated initializers in Xinput Replies 2012-07-09 19:58:30 -07:00
setmmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setmode.c Xi: always return BadMatch for XTest devices ChangeDeviceControl requests 2013-05-07 09:40:44 +10:00
setmode.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
stubs.c ddx: add new call to purge input devices that weren't added 2016-10-26 15:35:07 +10:00
ungrdev.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
ungrdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
ungrdevb.c dix: AllocGrab can copy if an argument is passed in 2013-05-10 14:32:37 +10:00
ungrdevb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
ungrdevk.c dix: AllocGrab can copy if an argument is passed in 2013-05-10 14:32:37 +10:00
ungrdevk.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiallowev.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xiallowev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xibarriers.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
xibarriers.h Xi: free barrier code at reset time 2013-05-07 09:41:19 +10:00
xichangecursor.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xichangecursor.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xichangehierarchy.c Xi: Silence some tautological warnings 2015-10-20 09:07:31 +10:00
xichangehierarchy.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xigetclientpointer.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xigetclientpointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xigrabdev.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xigrabdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xipassivegrab.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xipassivegrab.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiproperty.c Hold input lock while calling input device SetProperty callback 2016-09-15 07:50:34 +10:00
xiproperty.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiquerydevice.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xiquerydevice.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiquerypointer.c xinput: Let top-level dispatch generate the error 2016-08-16 15:56:24 -04:00
xiquerypointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiqueryversion.c Xi: Clamp XIClient maximal version to XIVersion 2013-08-01 14:51:41 +10:00
xiqueryversion.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiselectev.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xiselectev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xisetclientpointer.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xisetclientpointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xisetdevfocus.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xisetdevfocus.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiwarppointer.c Xi: unvalidated lengths in Xinput extension [CVE-2014-8095] 2014-12-08 18:09:48 -08:00
xiwarppointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00