Subject: [PATCH v3 0/9] powerpc/pkeys: fixes to pkeys

From: Ram Pai <[email-masked]>
Date: Tue, 17 Jul 2018 06:51:01 -0700

Assortment of fixes to pkey to match its behavior to that on x86.

Patch 1  makes pkey consumable in multithreaded applications.

Patch 2  Deny, by default, permissions on all unallocated keys.

Patch 3  pkey allocation/free must not change pkey registers.

Patch 4  fixes fork to inherit the key attributes.

Patch 5  A off-by-one bug made one key unusable. Fixes it.

Patch 6  Makes pkey-0 less special.

Patch 7 fix to core-pkeys selftest to capture the modified behavior

Patch 8 fix to ptrace-pkeys selftest to capture the modified behavior

The above patch series is successfully verified using pkey selftests,
on both powerpc and x86.

Ram Pai (9):
  powerpc/pkeys: Give all threads control of their key permissions
  powerpc/pkeys: Deny read/write/execute by default
  powerpc/pkeys: key allocation/deallocation must not change pkey
    registers
  powerpc/pkeys: Save the pkey registers before fork
  powerpc/pkeys: fix calculation of total pkeys.
  powerpc/pkeys: Preallocate execute-only key
  powerpc/pkeys: make protection key 0 less special
  powerpc/core-pkeys: execute-permission on keys are disabled by
    default
  powerpc/ptrace-pkeys: execute-permission on keys are disabled by
    default

 arch/powerpc/include/asm/pkeys.h                   |   40 +++---
 arch/powerpc/kernel/process.c                      |    1 +
 arch/powerpc/mm/pkeys.c                            |  141 +++++++-------------
 tools/testing/selftests/powerpc/ptrace/core-pkey.c |    4 +
 .../testing/selftests/powerpc/ptrace/ptrace-pkey.c |    5 +
 5 files changed, 79 insertions(+), 112 deletions(-)