lkml.org 
[lkml]   [2018]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0
    On Fri, Mar 9, 2018 at 7:12 PM, Ram Pai <linuxram@us.ibm.com> wrote:
    > Once an address range is associated with an allocated pkey, it cannot be
    > reverted back to key-0. There is no valid reason for the above behavior. On
    > the contrary applications need the ability to do so.
    >
    > The patch relaxes the restriction.

    I looked at the code and my observation was going to be that we need
    to change mm_pkey_is_allocated. I still fail to understand what
    happens if pkey 0 is reserved? What is the default key is it the first
    available key? Assuming 0 is the default key may work and seems to
    work, but I am sure its mostly by accident. It would be nice, if we
    could have a notion of the default key. I don't like the special
    meaning given to key 0 here. Remember on powerpc if 0 is reserved and
    UAMOR/AMOR does not allow modification because it's reserved, setting
    0 will still fail

    Balbir

    \
     
     \ /
      Last update: 2018-03-09 09:37    [W:4.066 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site