Ram Pai <linux...@us.ibm.com> writes:
> Key allocation and deallocation has the side effect of programming the > UAMOR/AMR/IAMR registers. This is wrong, since its the responsibility of > the application and not that of the kernel, to modify the permission on > the key. > > Do not modify the pkey registers at key allocation/deallocation. > > This patch also fixes a bug where a sys_pkey_free() resets the UAMOR > bits of the key, thus making its permissions unmodifiable from user > space. Latter if the same key gets reallocated from a different thread > this thread will no longer be able to change the permissions on the key. > > Problem noticed/reported by Michael Ellermen while running > selftests/core-pkeys > > Signed-off-by: Ram Pai <linux...@us.ibm.com> > --- > arch/powerpc/include/asm/pkeys.h | 11 ----------- > arch/powerpc/mm/pkeys.c | 27 --------------------------- > 2 files changed, 0 insertions(+), 38 deletions(-) LGTM. Reviewed-by: Thiago Jung Bauermann <bauer...@linux.ibm.com> -- Thiago Jung Bauermann IBM Linux Technology Center