diff mbox series

[2/2] powerpc/ptrace-pkeys: execute-permission on keys are disabled by default

Message ID 1529979376-7292-4-git-send-email-linuxram@us.ibm.com (mailing list archive)
State Awaiting Upstream
Headers show
Series None | expand

Commit Message

Ram Pai June 26, 2018, 2:16 a.m. UTC
The test case assumes execute-permissions of unallocated keys are
enabled by default.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 .../testing/selftests/powerpc/ptrace/ptrace-pkey.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Thiago Jung Bauermann July 3, 2018, 3:30 a.m. UTC | #1
Ram Pai <linuxram@us.ibm.com> writes:

> The test case assumes execute-permissions of unallocated keys are
> enabled by default.
>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> ---
>  .../testing/selftests/powerpc/ptrace/ptrace-pkey.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
> index 5cf631f..559c6cb 100644
> --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
> +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
> @@ -104,6 +104,11 @@ static int child(struct shared_info *info)
>
>  	if (disable_execute)
>  		info->expected_iamr |= 1ul << pkeyshift(pkey1);
> +	else
> +		info->expected_iamr &= ~(1ul << pkeyshift(pkey1));
> +	info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3));
> +
> +
>
>  	info->expected_uamor |= 3ul << pkeyshift(pkey1) |
>  				3ul << pkeyshift(pkey2);

Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
index 5cf631f..559c6cb 100644
--- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
+++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c
@@ -104,6 +104,11 @@  static int child(struct shared_info *info)
 
 	if (disable_execute)
 		info->expected_iamr |= 1ul << pkeyshift(pkey1);
+	else
+		info->expected_iamr &= ~(1ul << pkeyshift(pkey1));
+	info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3));
+
+
 
 	info->expected_uamor |= 3ul << pkeyshift(pkey1) |
 				3ul << pkeyshift(pkey2);