NetBSD-Bugs archive

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

kern/51731: {mustek,scanjet}_read insufficient locking



>Number:         51731
>Category:       kern
>Synopsis:       {mustek,scanjet}_read insufficient locking
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 20 21:20:00 +0000 2016
>Originator:     coypu
>Release:        NetBSD 7.99.51
>Organization:
>Environment:
NetBSD box 7.99.51 NetBSD 7.99.51 (GENERIC) #0: Sun Dec 18 07:53:19 IST 2016  fly@box:/usr/amd64/sys/arch/amd64/compile/GENERIC amd64

>Description:
This is not the most critical bug right now (the code seems to be for extremely old hardware), but it's subtle and hard to spot in the current code, so I report this bug as a reminder for its existence.

mustek_read calls scsipi_make_xs_locked with XS_CTL_NOSLEEP, apparently without holding chan_mtx.

this means scsipi_make_xs_locked will not attempt to lock and assumes that the lock is already held.
>How-To-Repeat:

>Fix:
Please add assertions for mutex_owned.
It may not trigger 100% of the times, but it's likely enough to happen that the problem will be spotted.



Home | Main Index | Thread Index | Old Index