CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]   2020/12/06 00:58:54

Modified files:
        sys/dev/wscons : wsmux.c 

Log message:
Fix yet another wscons race. In the same subsystem, the following
properties must always hold true:

1. A device (wsmouse0 is this scenario) can only be opened in rw mode
once. Such device cannot be a child of a wsmux at this point as it
operates on its own event queue.

2. A device being a child of a wsmux must use the wsmux event queue
assuming the wsmux is open. Otherwise, its event queue must be NULL.

There's a race in wsmux_attach_sc() allowing a device to be part of a
mux while using its own event queue. This in turn can cause a NULL
pointer deference in wsevent_fini() while closing the same device. The
solution is to check if the race was lost, i.e. another thread managed
to open the device in rw mode while sleeping in wsmux_attach_sc().

ok gnezdo@ visa@

Reported-by: [email protected]

Reply via email to