简体   繁体   中英

Copy on write vs illegal access

在Linux内核中,当进程尝试访问只读页面时,页面错误处理程序如何区分写时复制机制和非法内存访问?

arch/<arch>/mm/fault.cdo_page_fault()函数arch/<arch>/mm/fault.c “多路分解”发生页面错误的各种原因,并将控制权传递给适当的处理程序。

If the faulting page is in the userspace region of the address space, the page fault handler looks up the memory map of the current task. If the page is within a writable VMA (and the fault is a write fault) then it knows that it's a COW fault.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM