diff options
author | kib <kib@FreeBSD.org> | 2012-09-28 11:25:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-09-28 11:25:02 +0000 |
commit | 8f845e475e69e9777c5f940109bf0c45b87aadda (patch) | |
tree | 2c2a67940ecbf715c5dc909f32de63a9eed6f793 /sys/fs/coda | |
parent | 025fb75eb6e2720e82276647d1f8fad9515c281c (diff) | |
download | FreeBSD-src-8f845e475e69e9777c5f940109bf0c45b87aadda.zip FreeBSD-src-8f845e475e69e9777c5f940109bf0c45b87aadda.tar.gz |
Fix the mis-handling of the VV_TEXT on the nullfs vnodes.
If you have a binary on a filesystem which is also mounted over by
nullfs, you could execute the binary from the lower filesystem, or
from the nullfs mount. When executed from lower filesystem, the lower
vnode gets VV_TEXT flag set, and the file cannot be modified while the
binary is active. But, if executed as the nullfs alias, only the
nullfs vnode gets VV_TEXT set, and you still can open the lower vnode
for write.
Add a set of VOPs for the VV_TEXT query, set and clear operations,
which are correctly bypassed to lower vnode.
Tested by: pho (previous version)
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/coda')
-rw-r--r-- | sys/fs/coda/coda_subr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/coda/coda_subr.c b/sys/fs/coda/coda_subr.c index ecdd927..a7ae354 100644 --- a/sys/fs/coda/coda_subr.c +++ b/sys/fs/coda/coda_subr.c @@ -486,7 +486,7 @@ handleDownCall(struct coda_mntinfo *mnt, int opcode, union outputArgs *out) cache_purge(CTOV(cp)); cp->c_flags &= ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); - if (CTOV(cp)->v_vflag & VV_TEXT) + if (VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_ZAPFILE, myprintf(("zapfile: fid = %s, refcnt = %d, error = " @@ -532,7 +532,7 @@ handleDownCall(struct coda_mntinfo *mnt, int opcode, union outputArgs *out) cp->c_flags &= ~(C_VATTR | C_ACCCACHE); ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); if (!(IS_DIR(out->coda_purgefid.Fid)) - && (CTOV(cp)->v_vflag & VV_TEXT)) + && VOP_IS_TEXT(CTOV(cp))) error = coda_vmflush(cp); CODADEBUG(CODA_PURGEFID, myprintf(("purgefid: fid " "= %s, refcnt = %d, error = %d\n", |