Decoupled pte_read/write/exec()?
I'm faced with a bit of an issue interfacing a new MMU. Our previous ones were quite simple, lacking both explicit execute protections and following write implies read semantics. In this new case however we have a full read/write/execute set of permissions, for both user _and_ kernel access, effectively allowing for user mappings that aren't readable by the kernel.
What I've been doing so far is setting the access bits for both user and kernel space in the PTE modifiers and clearing out the user bit when the clear happens. This would seem to work, but I don't like the idea of leaving stray permission bits set, particularly with regards to the exec bit, though it is only for privileged space where it's not cleared.
Is there anything obvious that I'm missing? I suspect I will just have to have a software _PAGE_USER bit that gets set in these places to figure out which set of permissions to adjust, and make sure that the kernel permission bits match the userspace bits so long as _PAGE_USER is set.
It looks like PowerPC is doing something similar, particularly with regards to pte_mkexec()/pte_exprotect(), but this seems to deny the exec permission to the kernel as well, where pte_rdprotect() simply clears the user bit, and pte_wrprotect() simply implies user write protection.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>