• Ram Pai's avatar
    powerpc/pkeys: Preallocate execute-only key · a4fcc877
    Ram Pai authored
    execute-only key is allocated dynamically. This is a problem. When a
    thread implicitly creates an execute-only key, and resets the UAMOR
    for that key, the UAMOR value does not percolate to all the other
    threads. Any other thread may ignorantly change the permissions on the
    key. This can cause the key to be not execute-only for that thread.
    
    Preallocate the execute-only key and ensure that no thread can change
    the permission of the key, by resetting the corresponding bit in
    UAMOR.
    
    Fixes: 5586cf61 ("powerpc: introduce execute-only pkey")
    Cc: stable@vger.kernel.org # v4.16+
    Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    a4fcc877
pkeys.c 10.1 KB