Skip to content

Commit

Permalink
selftests/powerpc: Fix core-pkey for default execute permission change
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ram Pai authored and Michael Ellerman committed Jul 24, 2018
1 parent 07f522d commit 5db26e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/powerpc/ptrace/core-pkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5db26e8

Please sign in to comment.