39c928de1c
When a thread takes a page fault which results in COW resolution, other threads in the same process can be concurrently accessing that same mapping on other CPUs. When the faulting thread updates the pmap entry at the end of COW processing, the resulting TLB invalidations to other CPUs are not done atomically, so another thread can write to the new writable page and then a third thread might still read from the old read-only page, resulting in inconsistent views of the page by the latter two threads. Fix this by removing the pmap entry entirely for the original page before we install the new pmap entry for the new page, so that the new page can only be modified after the old page is no longer accessible. This fixes PR 56535 as well as the netbsd versions of problems described in various bug trackers: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225584 https://reviews.freebsd.org/D14347 https://github.com/golang/go/issues/34988 |
||
---|---|---|
.. | ||
pmap | ||
Makefile | ||
files.uvm | ||
uvm.h | ||
uvm_amap.c | ||
uvm_amap.h | ||
uvm_anon.c | ||
uvm_anon.h | ||
uvm_aobj.c | ||
uvm_aobj.h | ||
uvm_bio.c | ||
uvm_coredump.c | ||
uvm_ddb.h | ||
uvm_device.c | ||
uvm_device.h | ||
uvm_extern.h | ||
uvm_fault.c | ||
uvm_fault.h | ||
uvm_fault_i.h | ||
uvm_glue.c | ||
uvm_glue.h | ||
uvm_init.c | ||
uvm_io.c | ||
uvm_km.c | ||
uvm_km.h | ||
uvm_loan.c | ||
uvm_loan.h | ||
uvm_map.c | ||
uvm_map.h | ||
uvm_meter.c | ||
uvm_mmap.c | ||
uvm_mremap.c | ||
uvm_object.c | ||
uvm_object.h | ||
uvm_page.c | ||
uvm_page.h | ||
uvm_page_array.c | ||
uvm_page_array.h | ||
uvm_page_status.c | ||
uvm_pager.c | ||
uvm_pager.h | ||
uvm_param.h | ||
uvm_pdaemon.c | ||
uvm_pdaemon.h | ||
uvm_pdpolicy.h | ||
uvm_pdpolicy_clock.c | ||
uvm_pdpolicy_clockpro.c | ||
uvm_pdpolicy_impl.h | ||
uvm_pgflcache.c | ||
uvm_pgflcache.h | ||
uvm_pglist.c | ||
uvm_pglist.h | ||
uvm_physseg.c | ||
uvm_physseg.h | ||
uvm_pmap.h | ||
uvm_prot.h | ||
uvm_readahead.c | ||
uvm_readahead.h | ||
uvm_rndsource.h | ||
uvm_stat.c | ||
uvm_stat.h | ||
uvm_swap.c | ||
uvm_swap.h | ||
uvm_swapstub.c | ||
uvm_unix.c | ||
uvm_user.c | ||
uvm_vnode.c |