]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc/pkeys: Preallocate execute-only key
authorRam Pai <linuxram@us.ibm.com>
Tue, 17 Jul 2018 13:51:07 +0000 (06:51 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 24 Jul 2018 11:38:42 +0000 (21:38 +1000)
commita4fcc877d4e18b5efe26e93f08f0cfd4e278c7d9
tree26a7dbbf9d806368d47253802cc67b001720ccfd
parentfe6a2804e65969a574377bdb3605afb79e6091a9
powerpc/pkeys: Preallocate execute-only key

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: 5586cf61e108 ("powerpc: introduce execute-only pkey")
Cc: stable@vger.kernel.org # v4.16+
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/pkeys.c