Messages in this thread | | | Date | Fri, 8 May 2015 16:09:09 +1000 | From | Kevin Easton <> | Subject | Re: [PATCH 00/12] [RFC] x86: Memory Protection Keys |
| |
On Thu, May 07, 2015 at 08:18:43PM +0100, One Thousand Gnomes wrote: > > We could keep heap metadata as R/O and only make it R/W inside of > > malloc() itself to catch corruption more quickly. > > If you implement multiple malloc pools you can chop up lots of stuff. > > In library land it isn't just stuff like malloc, you can use it as > a debug weapon to protect library private data from naughty application > code.
How could a library (or debugger, for that matter) arbitrate ownership of the protection domains with the application?
One interesting use for it might be to be to provide an interface to allocate memory and associate it with a lock that's supposed to be held while accessing that memory. The allocation function hashes the lock address down to one of the 15 non-zero protection domains and applies that key to the memory, the lock function then adds RW access to the appropriate protection domain and the unlock function removes it.
- Kevin
| |