kselftest/arm64: Check mte tagged user address in kernel
authorAmit Daniel Kachhap <amit.kachhap@arm.com>
Fri, 2 Oct 2020 11:56:30 +0000 (17:26 +0530)
committerWill Deacon <will@kernel.org>
Mon, 5 Oct 2020 17:52:17 +0000 (18:52 +0100)
commit4dafc08d0ba4768e8540f49ab40c3ea26e40d554
treeabd3c2e5031537bd67107a13d31e129546a39fab
parentf981d8fa26469e19d2ce73006685ae88205e914a
kselftest/arm64: Check mte tagged user address in kernel

Add a testcase to check that user address with valid/invalid
mte tag works in kernel mode. This test verifies that the kernel
API's __arch_copy_from_user/__arch_copy_to_user works by considering
if the user pointer has valid/invalid allocation tags.

In MTE sync mode, file memory read/write and other similar interfaces
fails if a user memory with invalid tag is accessed in kernel. In async
mode no such failure occurs.

Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201002115630.24683-7-amit.kachhap@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
tools/testing/selftests/arm64/mte/.gitignore
tools/testing/selftests/arm64/mte/check_user_mem.c [new file with mode: 0644]
tools/testing/selftests/arm64/mte/mte_common_util.h
tools/testing/selftests/arm64/mte/mte_helper.S