Re: MPK: removing a pkey
From: Vlastimil Babka <hidden>
Date: 2017-11-24 08:39:55
Also in:
linux-arch, linux-mm
From: Vlastimil Babka <hidden>
Date: 2017-11-24 08:39:55
Also in:
linux-arch, linux-mm
On 11/24/2017 09:35 AM, Florian Weimer wrote:
On 11/24/2017 12:29 AM, Dave Hansen wrote:quoted
Although weird, the thought here was that pkey_mprotect() callers are new and should know about the interactions with PROT_EXEC. They can also*get* PROT_EXEC semantics if they want. The only wart here is if you do: mprotect(..., PROT_EXEC); // key 10 is now the PROT_EXEC keyI thought the PROT_EXEC key is always 1?
Seems it assigns the first non-allocated one. Can even fail if there's none left, and then there's no PROT_EXEC read protection. In practice I expect PROT_EXEC mapping to be created by ELF loader (?) before the program can even call pkey_alloc() itself, so it would be 1.