selftests/powerpc: Fix ptrace-pkey for default execute permission change
authorRam Pai <[email protected]>
Tue, 17 Jul 2018 13:51:10 +0000 (06:51 -0700)
committerMichael Ellerman <[email protected]>
Tue, 24 Jul 2018 12:03:14 +0000 (22:03 +1000)
The test case assumes execute-permissions of unallocated keys are
enabled by default, which is incorrect.

Reviewed-by: Thiago Jung Bauermann <[email protected]>
Signed-off-by: Ram Pai <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c

index 5cf631f792cc7e79fa403c90d02f45f4ba010a97..bdbbbe8431e03cb5d4476543ac2297779ae05964 100644 (file)
@@ -104,6 +104,10 @@ 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);