From owner-cvs-src-old@FreeBSD.ORG Thu Nov 26 05:17:03 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 349AA1065672 for ; Thu, 26 Nov 2009 05:17:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 230158FC12 for ; Thu, 26 Nov 2009 05:17:03 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQ5H3FN005577 for ; Thu, 26 Nov 2009 05:17:03 GMT (envelope-from alc@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nAQ5H37E005576 for cvs-src-old@freebsd.org; Thu, 26 Nov 2009 05:17:03 GMT (envelope-from alc@repoman.freebsd.org) Message-Id: <200911260517.nAQ5H37E005576@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to alc@repoman.freebsd.org using -f From: Alan Cox Date: Thu, 26 Nov 2009 05:16:07 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern sys_process.c src/sys/vm vm.h vm_fault.c vm_map.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 05:17:03 -0000 alc 2009-11-26 05:16:07 UTC FreeBSD src repository Modified files: sys/kern sys_process.c sys/vm vm.h vm_fault.c vm_map.c Log: SVN rev 199819 on 2009-11-26 05:16:07Z by alc Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE has represented a write access that is allowed to override write protection. Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into text pages. Text pages are not just write protected but they are also copy-on-write. VM_PROT_OVERRIDE_WRITE overrides the write protection on the text page and triggers the replication of the page so that the breakpoint will be written to a private copy. However, here is where things become confused. It is the debugger, not the process being debugged that requires write access to the copied page. Nonetheless, the copied page is being mapped into the process with write access enabled. In other words, once the debugger sets a breakpoint within a text page, the program can write to its private copy of that text page. Whereas prior to setting the breakpoint, a SIGSEGV would have occurred upon a write access. VM_PROT_COPY addresses this problem. The combination of VM_PROT_READ and VM_PROT_COPY forces the replication of a copy-on-write page even though the access is only for read. Moreover, the replicated page is only mapped into the process with read access, and not write access. Reviewed by: kib MFC after: 4 weeks Revision Changes Path 1.158 +12 -9 src/sys/kern/sys_process.c 1.34 +1 -1 src/sys/vm/vm.h 1.262 +1 -1 src/sys/vm/vm_fault.c 1.424 +10 -23 src/sys/vm/vm_map.c