Re: MPK: removing a pkey

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/24/2017 09:35 AM, Florian Weimer wrote:
> On 11/24/2017 12:29 AM, Dave Hansen wrote:
>> 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 key
> 
> I 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-x86_64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ia64]     [Linux Kernel]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux Hams]
  Powered by Linux