microsoft/snmalloc

PKU support

SchrodingerZhu opened this issue · 1 comments

https://www.man7.org/linux/man-pages/man7/pkeys.7.html

Just a discussion: could PKU/OSPKE possibily help snmalloc to remove the burden of notifying kernel of the permission changes?

I see a couple of potential problems with using MPK:

  • It's a finite (and tiny) key space, so consuming any of the values in the allocator may break code that wants to use them.
  • We only change permissions for simulating Windows' no-lazy-commit behaviour on *NIX. Most of our system calls are returning physical pages to the system.
  • MPK still requires page table updates to change permissions on a page, it just makes it cheap (and insecure) to change the set of pages that you can access, so this wouldn't help us speed up marking pages as no-access.

Did you have a particular use in mind?