[xf86-input-evdev][PATCH] links to event nodes

Christian Aistleitner kpdh2t at gmx.net
Wed Feb 28 15:19:47 PST 2007


Hello,

I use xf86-input-evdev 1.1.5.

If there is some (symbolic) link
/dev/input/eventX
pointing towards
/dev/input/eventY
and the xorg config file uses the device described by either of these two  
files, the result is a segfault at startup of the xorg server.
I know it's rather evil to have such a link in /dev/input in first place.

Within the funciton EvdevCorePreInit of src/evdev.ce, evdevNewDriver is  
called. This (among other things) calls evdevScanDevice for
/dev/input/eventX
and also for the device of
/dev/input/eventY
. The first of these two calls succeed. In the second call, the message  
DEVICE_ON is sent to the device->pInfo->dev via device->callback. But as  
device->pInfo->dev has not yet been initialized, it is still NULL.
When calling the callback, the first line of EvdevProc of src/evdev.c  
tries to evaluate
device->public.devicePrivate
, where device now resolves to NULL as described above. Hence a segfault.

The attached patch adds a sanity check to the message handling function  
EvdevProc of src/evdev.c and resolves the problem.

Kind regards,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_dev_links.diff
Type: application/octet-stream
Size: 361 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20070301/1c224d8a/attachment.obj>


More information about the xorg mailing list