xserver-multidpi/os
Peter Hutterer 2df2815d6a os: append, rather than prepend, any new input thread fds
xf86AddEnabledDevice() prepends the new fd to the list,
xf86RemoveEnabledDevice() then searches for a matching fd and removes that
entry. If this is done for the same fd (and since we lose all information but
the actual fd) we usually unregister virtual devices in reverse order, causing
a dereference of already released memory.

Case in point:
- the wacom driver calls xf86AddEnabledDevice() once for the physical device,
  then multiple times for the virtual subdevices
- when the physical device is unplugged, the driver calls
  xf86RemoveEnabledDevice() for the physical device
- all we have is the fd, so we end up removing the last virtual device from
  the fd set
- xf86DeleteInput() frees the physical device's pInfo
- the fd goes crazy with ENODEV, but a read_input() now passes the already
  freed pInfo for the physical device
- boom

Fix this by appending to the fd list to provide bug-for-bug compatibility with
the old SIGIO code. This needs to be fixed in the driver, but meanwhile not
crashing the server provides for better user experience.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-08-11 11:41:51 +10:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c Revert "XDMCP: For IPv6 add link local addresses to the end of the list" 2016-06-21 11:45:17 -04:00
auth.c os: support new implicit local user access mode [CVE-2015-3164 2/3] 2015-05-26 11:22:21 -07:00
backtrace.c Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
busfault.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
client.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
connection.c os: Remove CheckConnections 2016-07-21 15:04:47 -04:00
inputthread.c os: append, rather than prepend, any new input thread fds 2016-08-11 11:41:51 +10:00
io.c os: Switch server to poll(2) [v3] 2016-07-21 15:04:47 -04:00
log.c os: Failure to remove a non-existent log file is not an error 2016-01-06 12:23:31 -05:00
Makefile.am os: Add ospoll interface [v2] 2016-07-21 15:04:47 -04:00
mitauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
oscolor.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
osdep.h os: eliminate fd value limits for clients 2016-07-21 15:04:47 -04:00
osinit.c os: Leave stdin and stdout open 2016-07-21 15:04:47 -04:00
ospoll.c os: Add ospoll interface [v2] 2016-07-21 15:04:47 -04:00
ospoll.h os: Add ospoll interface [v2] 2016-07-21 15:04:47 -04:00
reallocarray.c Import reallocarray() from OpenBSD 2015-04-21 16:57:08 -07:00
rpcauth.c Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c os: Ensure <dix-config.h> is included in strndup.c 2013-02-14 09:20:46 -08:00
utils.c Allow 1024 and 2048 for LimitClients 2016-07-21 15:04:47 -04:00
WaitFor.c os: Clean up WaitFor.c 2016-07-21 15:04:47 -04:00
xdmauth.c os: unifdef STREAMSCONN 2016-02-08 21:49:56 -05:00
xdmcp.c os: Switch server to poll(2) [v3] 2016-07-21 15:04:47 -04:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xserver_poll.c os: Add poll emulation for mingw [v2] 2016-07-19 11:08:21 -07:00
xsha1.c os/xsha1.c: Add license and copyright attribution. 2015-01-02 13:39:52 -08:00
xstrans.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00