Bug 194643 - VFS vnode locking incorrect for non-lockmgr vnodes
Summary: VFS vnode locking incorrect for non-lockmgr vnodes
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2014-10-27 21:39 UTC by Conrad Meyer
Modified: 2015-07-22 15:39 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Meyer 2014-10-27 21:39:13 UTC
insmntque and probably other parts of VFS are broken for VFS that do not use lockmgr.

E.g. insmntque_stddtr enters with the vnode locked exclusive, wipes out the v_op table, and then calls vput() which uses VOP_ISLOCKED, VOP_LOCK, VOP_UNLOCK.

For VFS where vop_lock1, vop_unlock, vop_islocked doesn't use lockmgr, insmntque_stddtr leaks the original lock; then vput tries to upgrade via dead_vnops. This is pretty bogus. Even for VFS that use lockmgr, insmntque_stddtr doesn't reset v_vnlock to &v_lock; it should probably do this (or just let vgone() do it).

Additionally, since vgonel() wipes out v_op with dead_vnops, anything else that holds a vnode lock over vgone() is bogus. (But, not observably so for lockmgr- / v_lock-using VFS.)