]> git.baikalelectronics.ru Git - kernel.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)
commit664bce89756722cb0a32a7725fb9f531b45f5e5a
tree26a7dbbf9d806368d47253802cc67b001720ccfd
parent8318ab0d51ac9d47594c2cdf9b83792a6e7db0eb
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: e1506e43c39e ("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