summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-02-05 21:21:27 +0000
committeralc <alc@FreeBSD.org>2011-02-05 21:21:27 +0000
commit11491a4c5e318059ea9051b6523ce066255020e4 (patch)
tree17ca053f5237cdf00df048613ae24ad00ba77d0e /sys/security
parent0410b9c4fd31dc29ce008f99b4f751d2a0dc37fe (diff)
downloadFreeBSD-src-11491a4c5e318059ea9051b6523ce066255020e4.zip
FreeBSD-src-11491a4c5e318059ea9051b6523ce066255020e4.tar.gz
Unless "cnt" exceeds MAX_COMMIT_COUNT, nfsrv_commit() and nfsvno_fsync() are
incorrectly calling vm_object_page_clean(). They are passing the length of the range rather than the ending offset of the range. Perform the OFF_TO_IDX() conversion in vm_object_page_clean() rather than the callers. Reviewed by: kib MFC after: 3 weeks
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac/mac_process.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c
index 5b692dd..214e748 100644
--- a/sys/security/mac/mac_process.c
+++ b/sys/security/mac/mac_process.c
@@ -338,11 +338,8 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred,
(void) vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
VM_OBJECT_LOCK(object);
- vm_object_page_clean(object,
- OFF_TO_IDX(offset),
- OFF_TO_IDX(offset + vme->end - vme->start +
- PAGE_MASK),
- OBJPC_SYNC);
+ vm_object_page_clean(object, offset, offset +
+ vme->end - vme->start, OBJPC_SYNC);
VM_OBJECT_UNLOCK(object);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
OpenPOWER on IntegriCloud