freebsd-dev/sys/compat
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
..
freebsd32 regen. 2012-08-17 02:47:16 +00:00
ia32 Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct 2012-07-22 13:41:45 +00:00
linprocfs Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
linsysfs Add procfs to jail-mountable filesystems. 2012-02-29 00:30:18 +00:00
linux The r241025 fixed the case when a binary, executed from nullfs mount, 2012-11-02 13:56:36 +00:00
ndis Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
netbsd Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
svr4 Remove the support for using non-mpsafe filesystem modules. 2012-10-22 17:50:54 +00:00
x86bios Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00