From ff8f4ebe22dc4377e7c31fc9e57dd11406f1c219 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 18 Apr 2002 03:55:50 +0000 Subject: [PATCH] Add a comment documenting a race condition in vm_fault(): Specifically, a modification is made to the vm_map while only a read lock is held. --- sys/vm/vm_fault.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 2d463500554b..bdac6b840dd7 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -258,6 +258,9 @@ RetryFault:; * If we don't COW now, on a user wire, the user will never * be able to write to the mapping. If we don't make this * restriction, the bookkeeping would be nearly impossible. + * + * XXX The following assignment modifies the map without + * holding a write lock on it. */ if ((fs.entry->protection & VM_PROT_WRITE) == 0) fs.entry->max_protection &= ~VM_PROT_WRITE;