-
- Downloads
Implement mprotect(). There's still one missing feature though - PROT_NONE
is not currently supported, and PROT_READ is used instead (i.e., instead of inaccessible memory, one gets read-only memory). Inaccessible memory complicates the code because it means using the non-present bit on still-allocated pages, and then unpopulate() can't use the present bit to decide which pages are allocated and need to be freed. To fix this, I'll need to: 1. unpopulate_page() and unpopulate_huge_page() should assume it is only ever called on allocated pages (evacute() actually ensures that!), and not return on non-present ptes. 2. change_perm() should use the read_perm to set the present bit. 3. protect() shouldn't rely on present bit to know when to return 0 or 1, rather it must be wrapped in something like evacute() which knows to find mapped ranges, and only call protect() for actually mapped ranges. I'll try this tomorrow.
Loading
Please register or sign in to comment