From 7e9d944218ef5ed4e9954cf9da397751db9f0435 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 8 Nov 2005 06:33:21 +0000 Subject: [PATCH] If a physical page is mapped by two or more virtual addresses, transmitted by the zero-copy sockets method, and written to before the transmission completes, we need to destroy all of the existing mappings to the page, not just the one that we fault on. Otherwise, the mappings will no longer be to the same page and changes made through one of the mappings will not be visible through the others. Observed by: tegge --- sys/vm/vm_page.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 94943ecc58c2..9cc8642bb93c 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1651,6 +1651,7 @@ vm_page_cowfault(vm_page_t m) pindex = m->pindex; retry_alloc: + pmap_remove_all(m); vm_page_remove(m); mnew = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); if (mnew == NULL) {