diff options
author | James Morse <james.morse@arm.com> | 2016-02-05 14:58:48 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2016-02-18 17:27:04 +0000 |
commit | 57f4959bad0a154aeca125b7d38d1d9471a12422 (patch) | |
tree | 6d75f86840bb0bd2d3f4928993f696c44e2033c0 /arch/arm64/Kconfig | |
parent | 406e308770a92bd33995b2e5b681e86358328bb0 (diff) | |
download | linux-57f4959bad0a154aeca125b7d38d1d9471a12422.tar.gz linux-57f4959bad0a154aeca125b7d38d1d9471a12422.tar.bz2 linux-57f4959bad0a154aeca125b7d38d1d9471a12422.zip |
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>
Diffstat (limited to 'arch/arm64/Kconfig')
-rw-r--r-- | arch/arm64/Kconfig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fa51ff0470c1..3d9cab156740 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -756,6 +756,27 @@ config ARM64_LSE_ATOMICS endmenu +config ARM64_UAO + bool "Enable support for User Access Override (UAO)" + default y + help + User Access Override (UAO; part of the ARMv8.2 Extensions) + causes the 'unprivileged' variant of the load/store instructions to + be overriden to be privileged. + + This option changes get_user() and friends to use the 'unprivileged' + variant of the load/store instructions. This ensures that user-space + really did have access to the supplied memory. When addr_limit is + set to kernel memory the UAO bit will be set, allowing privileged + access to kernel memory. + + Choosing this option will cause copy_to_user() et al to use user-space + memory permissions. + + The feature is detected at runtime, the kernel will use the + regular load/store instructions if the cpu does not implement the + feature. + endmenu menu "Boot options" |