NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/38801: most drivers assume seralized d_open/d_close



>Number:         38801
>Category:       kern
>Synopsis:       most drivers assume seralized d_open/d_close
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 30 16:45:00 +0000 2008
>Originator:     Andrew Doran
>Release:        4.99.63
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
Most drivers assume the following but it's not true:

- calls to open() will not overlap
- open() and close() will not overlap

Solaris prevents it, and older versions of NetBSD prevented it. At some 
point a hack was added for tty devices that released the vnode lock while 
a device was being opened/closed, as ttys are known to sleep long-term in 
their open/close routines.

>How-To-Repeat:
Code inspection.
>Fix:
Serialize all open/close activity. To be complete it would need to be
done by major number as we have no way of decoding the minor.

Ensure that any long-term waits in d_open/d_close are interruptible.



Home | Main Index | Thread Index | Old Index