Andrey Konovalov 14d0bfec3f UPSTREAM: arm64: untag user pointers in access_ok and __uaccess_mask_ptr
(Upstream commit 2b835e24b5).

This patch is a part of a series that extends kernel ABI to allow to pass
tagged user pointers (with the top byte set to something else other than
0x00) as syscall arguments.

copy_from_user (and a few other similar functions) are used to copy data
from user memory into the kernel memory or vice versa. Since a user can
provided a tagged pointer to one of the syscalls that use copy_from_user,
we need to correctly handle such pointers.

Do this by untagging user pointers in access_ok and in __uaccess_mask_ptr,
before performing access validity checks.

Note, that this patch only temporarily untags the pointers to perform the
checks, but then passes them as is into the kernel internals.

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
[will: Add __force to casting in untagged_addr() to kill sparse warning]
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Bug: 135692346
Change-Id: Ia97d1d311c2e2bf8e4584005b5085204db6d8955
2019-10-07 15:27:39 -04:00
2019-07-26 10:31:53 +02:00
2019-10-07 19:17:35 +02:00
2019-10-07 19:17:35 +02:00
2019-10-01 08:51:37 +02:00
2019-08-06 20:08:18 +02:00
2019-10-07 19:17:35 +02:00
2019-10-07 19:17:35 +02:00
2019-10-06 11:27:45 +02:00
2019-10-07 19:17:35 +02:00
2019-10-06 11:27:45 +02:00
2019-10-07 19:17:35 +02:00
2019-10-06 11:27:45 +02:00
2019-10-07 19:17:35 +02:00
2019-10-07 19:17:35 +02:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 7.9 GiB
Languages
C 97.7%
Assembly 1.6%
Makefile 0.3%
Perl 0.1%