summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRam Pai <linuxram@us.ibm.com>2018-07-17 06:51:09 -0700
committerMichael Ellerman <mpe@ellerman.id.au>2018-07-24 22:02:29 +1000
commit5db26e8903deb111b303bd6e0cf304215e0b4fd9 (patch)
tree4a9d3cc662317b90934d762aec7c3bf06a894f14 /tools
parent07f522d203242b359624a284b61977600eebfd5a (diff)
downloadblackbird-op-linux-5db26e8903deb111b303bd6e0cf304215e0b4fd9.tar.gz
blackbird-op-linux-5db26e8903deb111b303bd6e0cf304215e0b4fd9.zip
selftests/powerpc: Fix core-pkey for default execute permission change
Only when the key is allocated, its permission are enabled. Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/powerpc/ptrace/core-pkey.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
index 36bc312b1f5c..e23e2e199eb4 100644
--- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c
+++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c
@@ -140,6 +140,10 @@ static int child(struct shared_info *info)
if (disable_execute)
info->iamr |= 1ul << pkeyshift(pkey1);
+ else
+ info->iamr &= ~(1ul << pkeyshift(pkey1));
+
+ info->iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3));
info->uamor |= 3ul << pkeyshift(pkey1) | 3ul << pkeyshift(pkey2);
OpenPOWER on IntegriCloud