freebsd-nq/sys/fs
Konstantin Belousov 99ec92c962 After the pfs_vncache_mutex is dropped, another thread may attempt to
do pfs_vncache_alloc() for the same pfs_node and pid. In this case, we
could end up with two vnodes for the pair. Recheck the cache under the
locked pfs_vncache_mutex after all sleeping operations are done [1].

This case mostly cannot happen now because pseudofs uses exclusive vnode
locking for lookup. But it does drop the vnode lock for dotdot lookups,
and Marcus' pseudofs_vptocnp implementation is vulnerable too.

Do not call free() on the struct pfs_vdata after insmntque() failure,
because vp->v_data points to the structure, and pseudofs_reclaim()
frees it by the call to pfs_vncache_free().

Tested by:	pho [1]
Approved by:	des
MFC after:	2 weeks
2008-12-29 12:07:18 +00:00
..
cd9660 The timezone byte is a signed value, treat it as such. 2008-11-27 06:21:04 +00:00
coda Fix few missed accmode changes in coda. 2008-11-03 16:36:23 +00:00
deadfs Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. 2008-12-12 00:59:36 +00:00
devfs Do not leak defs_de_interlock on error. 2008-12-12 11:10:10 +00:00
fdescfs Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
fifofs Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
hpfs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
msdosfs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
ntfs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
nullfs In null_lookup(), do the needed cleanup instead of panicing saying 2008-11-26 13:41:15 +00:00
nwfs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
portalfs Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
procfs Reference the vmspace of the process being inspected by procfs, linprocfs 2008-12-12 12:12:36 +00:00
pseudofs After the pfs_vncache_mutex is dropped, another thread may attempt to 2008-12-29 12:07:18 +00:00
smbfs According to phk@, VOP_STRATEGY should never, _ever_, return 2008-12-16 21:13:11 +00:00
tmpfs Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary 2008-10-28 13:44:11 +00:00
udf Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary 2008-10-28 13:44:11 +00:00
unionfs Simplify mode_t check treatment (suggested by trasz). 2008-11-25 03:49:41 +00:00