[PATCH 0/3] Make timers even more resistant to signals

Daniel Kurtz djkurtz at chromium.org
Sat Sep 22 06:28:34 PDT 2012


X Input drivers, such as xf86-input-synaptics, tend to do all of their
processing in a SIGIO signal handler.  This processing often involves
creating, modifying or canceling a timer.  Any of these operations may
modify the global "timers" array.  Therefore, all accesses of this global
must be done in critical secitions during which signals are blocked.

Otherwise, for example, a signal may clear the last timer between, which
sets timers global to NULL, between the NULL check and checking "expires",
which causes a SEGV.

A previous patch protected write accesses.  However, this is not
sufficient. Read accesses must also be protected from a signal
occurring between when the timers is NULL checked and subsequent
dereferences.

This patchset also does some small clean up to the timer list processing.
Although, the whole timer list should probably be rewritten someday
using the more modern - and better tested - struct xorg_list...

Daniel Kurtz (3):
  os: block signals when accessing global timer list
  os: refactor timer processing
  os: refactor CheckAllTimers

 os/WaitFor.c |   79 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 42 insertions(+), 37 deletions(-)

-- 
1.7.7.3



More information about the xorg-devel mailing list