freebsd-dev/sys/fs
Konstantin Belousov 140dedb81c The r241025 fixed the case when a binary, executed from nullfs mount,
was still possible to open for write from the lower filesystem.  There
is a symmetric situation where the binary could already has file
descriptors opened for write, but it can be executed from the nullfs
overlay.

Handle the issue by passing one v_writecount reference to the lower
vnode if nullfs vnode has non-zero v_writecount.  Note that only one
write reference can be donated, since nullfs only keeps one use
reference on the lower vnode.  Always use the lower vnode v_writecount
for the checks.

Introduce the VOP_GET_WRITECOUNT to read v_writecount, which is
currently always bypassed to the lower vnode, and VOP_ADD_WRITECOUNT
to manipulate the v_writecount value, which manages a single bypass
reference to the lower vnode.  Caling the VOPs instead of directly
accessing v_writecount provide the fix described in the previous
paragraph.

Tested by:	pho
MFC after:	3 weeks
2012-11-02 13:56:36 +00:00
..
cd9660 Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
coda Fix the mis-handling of the VV_TEXT on the nullfs vnodes. 2012-09-28 11:25:02 +00:00
deadfs The deadfs VOPs for vop_ioctl and vop_bmap call itself recursively, 2012-09-13 13:05:45 +00:00
devfs Prefer __containerof() above member2struct(). 2012-09-15 19:28:54 +00:00
ext2fs Fix up kernel sources to be ready for a 64-bit ino_t. 2012-09-27 23:30:49 +00:00
fdescfs Use NULL instead of 0 2012-03-13 10:04:13 +00:00
fifofs I am comparing current pipe code with the one in 8.3-STABLE r236165, 2012-07-31 05:48:35 +00:00
fuse Remove unneeded D_NEEDMINOR. 2012-10-18 19:28:31 +00:00
hpfs Fix up kernel sources to be ready for a 64-bit ino_t. 2012-09-27 23:30:49 +00:00
msdosfs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
nandfs remove duplicate semicolons where possible. 2012-10-22 03:00:37 +00:00
nfs Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
nfsclient Modify the NFSv4 client so that it can handle owner 2012-09-20 02:49:25 +00:00
nfsserver Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
ntfs Fix up kernel sources to be ready for a 64-bit ino_t. 2012-09-27 23:30:49 +00:00
nullfs The r241025 fixed the case when a binary, executed from nullfs mount, 2012-11-02 13:56:36 +00:00
nwfs Do not leave invalid pages in the object after the short read for a 2012-08-14 11:45:47 +00:00
portalfs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
procfs Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
pseudofs Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs. 2012-03-05 11:38:02 +00:00
smbfs - Do not put in the mntqueue half-constructed vnodes. 2012-10-31 03:55:33 +00:00
tmpfs Fix up kernel sources to be ready for a 64-bit ino_t. 2012-09-27 23:30:49 +00:00
udf Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
unionfs The r241025 fixed the case when a binary, executed from nullfs mount, 2012-11-02 13:56:36 +00:00