From ac94e44f1fbe2173edc9c790a789d66973169f05 Mon Sep 17 00:00:00 2001 From: csjp Date: Tue, 4 Oct 2005 14:47:47 +0000 Subject: [PATCH] Use the correct object's backing_object_offset while calculating offsets. While we are here, add a note that we need to lock the object before walking the backing object list. Pointed out by: alc Discussed with: rwatson --- sys/security/mac/mac_process.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c index 170670c0f183..67bda6fa7742 100644 --- a/sys/security/mac/mac_process.c +++ b/sys/security/mac/mac_process.c @@ -354,9 +354,12 @@ mac_cred_mmapped_drop_perms_recurse(struct thread *td, struct ucred *cred, object = vme->object.vm_object; if (object == NULL) continue; + /* XXXCSJP We need to lock the object before walking + * the backing object list. + */ while (object->backing_object != NULL) { - object = object->backing_object; offset += object->backing_object_offset; + object = object->backing_object; } /* * At the moment, vm_maps and objects aren't considered