summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/uaccess.h
diff options
context:
space:
mode:
authorKristina Martsenko <kristina.martsenko@arm.com>2017-05-03 16:37:45 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2017-05-09 17:26:17 +0100
commit81cddd65b5c82758ea5571a25e31ff6f1f89ff02 (patch)
treec2fd4782c5f9e145af57f562d082dec69d351786 /arch/arm64/include/asm/uaccess.h
parent92f66f84d9695d07adf9bc987bbcce4bf9b8e87c (diff)
downloadop-kernel-dev-81cddd65b5c82758ea5571a25e31ff6f1f89ff02.zip
op-kernel-dev-81cddd65b5c82758ea5571a25e31ff6f1f89ff02.tar.gz
arm64: traps: fix userspace cache maintenance emulation on a tagged pointer
When we emulate userspace cache maintenance in the kernel, we can currently send the task a SIGSEGV even though the maintenance was done on a valid address. This happens if the address has a non-zero address tag, and happens to not be mapped in. When we get the address from a user register, we don't currently remove the address tag before performing cache maintenance on it. If the maintenance faults, we end up in either __do_page_fault, where find_vma can't find the VMA if the address has a tag, or in do_translation_fault, where the tagged address will appear to be above TASK_SIZE. In both cases, the address is not mapped in, and the task is sent a SIGSEGV. This patch removes the tag from the address before using it. With this patch, the fault is handled correctly, the address gets mapped in, and the cache maintenance succeeds. As a second bug, if cache maintenance (correctly) fails on an invalid tagged address, the address gets passed into arm64_notify_segfault, where find_vma fails to find the VMA due to the tag, and the wrong si_code may be sent as part of the siginfo_t of the segfault. With this patch, the correct si_code is sent. Fixes: 7dd01aef0557 ("arm64: trap userspace "dc cvau" cache operation on errata-affected core") Cc: <stable@vger.kernel.org> # 4.8.x- Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/uaccess.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud