From 8f845e475e69e9777c5f940109bf0c45b87aadda Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 28 Sep 2012 11:25:02 +0000 Subject: 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 --- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/fs/nfsserver') diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 4729859..21d184b 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -252,7 +252,7 @@ nfsvno_accchk(struct vnode *vp, accmode_t accmode, struct ucred *cred, * the inode, try to free it up once. If * we fail, we can't allow writing. */ - if ((vp->v_vflag & VV_TEXT) != 0 && error == 0) + if (VOP_IS_TEXT(vp) && error == 0) error = ETXTBSY; } if (error != 0) { -- cgit v1.1