diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2019-12-05 16:57:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-13 10:42:56 +0300 |
commit | 1ac33be2306eeadc8be21ed12c80ea981a28b397 (patch) | |
tree | b83bb92399f16ec4ca0227177e7146553bf2a1ba /arch/powerpc/perf | |
parent | 5d8115f5357514c9fca42f6effdd4d06aefccab2 (diff) | |
download | linux-1ac33be2306eeadc8be21ed12c80ea981a28b397.tar.xz |
arm64: Validate tagged addresses in access_ok() called from kernel threads
commit df325e05a682e9c624f471835c35bd3f870d5e8c upstream.
__range_ok(), invoked from access_ok(), clears the tag of the user
address only if CONFIG_ARM64_TAGGED_ADDR_ABI is enabled and the thread
opted in to the relaxed ABI. The latter sets the TIF_TAGGED_ADDR thread
flag. In the case of asynchronous I/O (e.g. io_submit()), the
access_ok() may be called from a kernel thread. Since kernel threads
don't have TIF_TAGGED_ADDR set, access_ok() will fail for valid tagged
user addresses. Example from the ffs_user_copy_worker() thread:
use_mm(io_data->mm);
ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data);
unuse_mm(io_data->mm);
Relax the __range_ok() check to always untag the user address if called
in the context of a kernel thread. The user pointers would have already
been checked via aio_setup_rw() -> import_{single_range,iovec}() at the
time of the asynchronous I/O request.
Fixes: 63f0c6037965 ("arm64: Introduce prctl() options to control the tagged user addresses ABI")
Cc: <stable@vger.kernel.org> # 5.4.x-
Cc: Will Deacon <will@kernel.org>
Reported-by: Evgenii Stepanov <eugenis@google.com>
Tested-by: Evgenii Stepanov <eugenis@google.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/perf')
0 files changed, 0 insertions, 0 deletions