NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/56535 CVS commit: src/sys/uvm



The following reply was made to PR kern/56535; it has been noted by GNATS.

From: "Chuck Silvers" <chs%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/56535 CVS commit: src/sys/uvm
Date: Sun, 13 Aug 2023 23:06:07 +0000

 Module Name:	src
 Committed By:	chs
 Date:		Sun Aug 13 23:06:07 UTC 2023
 
 Modified Files:
 	src/sys/uvm: uvm_fault.c
 
 Log Message:
 uvm: prevent TLB invalidation races during COW resolution
 
 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
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.233 -r1.234 src/sys/uvm/uvm_fault.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index