arm64: kernel: Add support for User Access Override
authorJames Morse <james.morse@arm.com>
Fri, 5 Feb 2016 14:58:48 +0000 (14:58 +0000)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 14:19:23 +0000 (22:19 +0800)
commit13e05550e107e46ef982e5c4347e4986aeeee7ec
tree6e1f5c028f590ded69239fffe1285e2d93b1f3f1
parentf6c5d808273093c8220da4163c548932d18e8e36
arm64: kernel: Add support for User Access Override

'User Access Override' is a new ARMv8.2 feature which allows the
unprivileged load and store instructions to be overridden to behave in
the normal way.

This patch converts {get,put}_user() and friends to use ldtr*/sttr*
instructions - so that they can only access EL0 memory, then enables
UAO when fs==KERNEL_DS so that these functions can access kernel memory.

This allows user space's read/write permissions to be checked against the
page tables, instead of testing addr<USER_DS, then using the kernel's
read/write permissions.

Signed-off-by: James Morse <james.morse@arm.com>
[catalin.marinas@arm.com: move uao_thread_switch() above dsb()]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 57f4959bad0a154aeca125b7d38d1d9471a12422)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
15 files changed:
arch/arm64/Kconfig
arch/arm64/include/asm/alternative.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/thread_info.h
arch/arm64/include/asm/uaccess.h
arch/arm64/include/uapi/asm/ptrace.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/process.c
arch/arm64/lib/clear_user.S
arch/arm64/lib/copy_from_user.S
arch/arm64/lib/copy_in_user.S
arch/arm64/lib/copy_to_user.S
arch/arm64/mm/fault.c