diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2012-09-28 11:25:02 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2012-09-28 11:25:02 +0000 |
commit | 877d24ac8ac9ccc82bf610d00beacfcb80dca686 (patch) | |
tree | 2c2a67940ecbf715c5dc909f32de63a9eed6f793 /sys/nfsserver | |
parent | eacee75a76ddc1edecb4c2520c88ff91c0c27e93 (diff) | |
download | src-877d24ac8ac9ccc82bf610d00beacfcb80dca686.tar.gz src-877d24ac8ac9ccc82bf610d00beacfcb80dca686.zip |
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
Notes
Notes:
svn path=/head/; revision=241025
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index e51c761eee7f..ae8f6d6becee 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -3896,7 +3896,7 @@ nfsrv_access(struct vnode *vp, accmode_t accmode, struct ucred *cred, * If there's shared text associated with * the inode, we can't allow writing. */ - if (vp->v_vflag & VV_TEXT) + if (VOP_IS_TEXT(vp)) return (ETXTBSY); } |