]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When protection of wired read-only mapping is changed to read-write,
authorkib <kib@FreeBSD.org>
Tue, 27 Oct 2009 10:15:58 +0000 (10:15 +0000)
committerkib <kib@FreeBSD.org>
Tue, 27 Oct 2009 10:15:58 +0000 (10:15 +0000)
commitfeb999713be0c5c7cf9239074dd5d49d5dff1fa0
tree3db96f50949e0d11ed042308a247806c6d75a745
parent10cb9d698c9cbeb3f32887483e1276e9290e7e39
When protection of wired read-only mapping is changed to read-write,
install new shadow object behind the map entry and copy the pages
from the underlying objects to it. This makes the mprotect(2) call to
actually perform the requested operation instead of silently do nothing
and return success, that causes SIGSEGV on later write access to the
mapping.

Reuse vm_fault_copy_entry() to do the copying, modifying it to behave
correctly when src_entry == dst_entry.

Reviewed by: alc
MFC after: 3 weeks
sys/vm/vm_fault.c
sys/vm/vm_map.c