freebsd-dev/sys/fs/unionfs
Jason A. Harmening 06f79675b7 unionfs: fix potential deadlock in VOP_RMDIR
VOP_RMDIR() is called with both parent and child directory vnodes
locked.  The relookup operation performed by the unionfs implementation
may relock both vnodes.  Accordingly, unionfs_relookup() drops the
parent vnode lock, but the child vnode lock is never dropped.
Although relookup() will very likely try to relock the child vnode
which is already locked, in most cases this doesn't produce a deadlock
because unionfs_lock() forces LK_CANRECURSE (!).  However, relocking
of the parent vnode while the child vnode remains locked effectively
reverses the expected parent->child lock order, which can produce
a deadlock e.g. in the presence of a concurrent unionfs_lookup()
operation.  Address the issue by dropping the child lock around
the unionfs_relookup() call in unionfs_rmdir().

Reported by:	pho
Reviewed by:	kib, markj
Differential Revision: https://reviews.freebsd.org/D32986
2021-11-14 20:07:42 -08:00
..
union_subr.c unionfs: Improve vnode validation 2021-11-06 07:08:34 -07:00
union_vfsops.c unionfs: style 2021-09-01 07:55:37 -07:00
union_vnops.c unionfs: fix potential deadlock in VOP_RMDIR 2021-11-14 20:07:42 -08:00
union.h unionfs: Improve vnode validation 2021-11-06 07:08:34 -07:00