summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-03-02 22:13:28 +0000
committertegge <tegge@FreeBSD.org>2006-03-02 22:13:28 +0000
commit774f51ad2c9890088551e2fef8c7c2ec8bc1e446 (patch)
treea136dfc347b9ef7b044439ec33fe997d02fb4061 /sys/security
parent29fc266dddf27264a642495e94c044465289b437 (diff)
downloadFreeBSD-src-774f51ad2c9890088551e2fef8c7c2ec8bc1e446.zip
FreeBSD-src-774f51ad2c9890088551e2fef8c7c2ec8bc1e446.tar.gz
Eliminate a deadlock when creating snapshots. Blocking vn_start_write() must
be called without any vnode locks held. Remove calls to vn_start_write() and vn_finished_write() in vnode_pager_putpages() and add these calls before the vnode lock is obtained to most of the callers that don't already have them.
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac/mac_process.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c
index 9b72cbd..b805545 100644
--- a/sys/security/mac/mac_process.c
+++ b/sys/security/mac/mac_process.c
@@ -330,6 +330,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred,
vm_object_t backing_object, object;
vm_ooffset_t offset;
struct vnode *vp;
+ struct mount *mp;
if (!mac_mmap_revocation)
return;
@@ -407,6 +408,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred,
* copy-on-write.
*/
vm_object_reference(object);
+ (void) vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
VM_OBJECT_LOCK(object);
vm_object_page_clean(object,
@@ -416,6 +418,7 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred,
OBJPC_SYNC);
VM_OBJECT_UNLOCK(object);
VOP_UNLOCK(vp, 0, td);
+ vn_finished_write(mp);
vm_object_deallocate(object);
/*
* Why bother if there's no read permissions
OpenPOWER on IntegriCloud