powerpc/book3s64/kuap: Restrict access to userspace based on userspace AMR
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Fri, 27 Nov 2020 04:44:17 +0000 (10:14 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Dec 2020 14:01:26 +0000 (01:01 +1100)
commit4d6c551e9f548f7675a01eff229d09ab41162a25
tree401c9a20fe6ea4335b9c9dfbecd2faf12dc3b838
parent48a8ab4eeb8271f2a0e2ca3cf80844a59acca153
powerpc/book3s64/kuap: Restrict access to userspace based on userspace AMR

If an application has configured address protection such that read/write is
denied using pkey even the kernel should receive a FAULT on accessing the same.

This patch use user AMR value stored in pt_regs.amr to achieve the same.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201127044424.40686-16-aneesh.kumar@linux.ibm.com
arch/powerpc/include/asm/book3s/64/kup.h