[PATCH xserver] os: don't re-remove an already removed fd

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 11 05:23:54 UTC 2016


On Wed, Aug 10, 2016 at 10:13:31PM -0700, Keith Packard wrote:
> Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> > If a driver calls xf86RemoveEnabledDevice() twice for the same fd we race with
> > InputThreadDoWork(). If it gets called in between both fd entries are removed.
> > If InputThreadDoWork() does not get called in between, we merely try to remove
> > the same fd twice and then cause a read_input() call on an already removed
> > device later.
> 
> Some driver actually counts on being able to register the same FD
> multiple times?  Only one of the functions will get called, so wouldn't
> it be better to not allow the registration in the first place?

wacom does. and yes, it needs to get fixed in the driver now that it
doesn't work anymore but meanwhile not crashing is still good.

Cheers,
   Peter


More information about the xorg-devel mailing list