[PATCH] Linux: Implement interfaces for memory protection keys

Florian Weimer fweimer@redhat.com
Mon Nov 6 13:40:00 GMT 2017


On 11/06/2017 02:29 PM, Joseph Myers wrote:
> On Sun, 5 Nov 2017, Florian Weimer wrote:
> 
>> On 11/04/2017 06:49 PM, Florian Weimer wrote:
>>> This adds system call wrappers for pkey_alloc, pkey_free, pkey_mprotect,
>>> and x86-64 implementations of pkey_get and pkey_set, which abstract over
>>> the PKRU CPU register and hide the actual number of memory protection
>>> keys supported by the CPU.
>>>
>>> The system call wrapers use unsigned int instead of unsigned long for
>>> parameters, so that no special treatment for x32 is needed.  The flags
>>> argument is currently unused, and the access rights bit mask is limited
>>> to two bits by the current PKRU register layout anyway.
>>
>> I again forgot to add a NEWS entry.
> 
> Documentation in the glibc manual is also needed.

What's the general feeling about these interfaces?  Shall we add them, 
despite their limitations (especially with regard to key reuse)?

Then I'll write documentation.

Thanks,
Florian



More information about the Libc-alpha mailing list