Date: Thu, 26 Nov 2009 05:16:07 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern sys_process.c src/sys/vm vm.h vm_fault.c vm_map.c Message-ID: <200911260517.nAQ5H37E005576@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911260517.nAQ5H37E005576>
