Skip to content
Commit d0a00576 authored by Mark Rutland's avatar Mark Rutland Committed by Olav Haugan
Browse files

arm64: uaccess: consistently check object sizes



Currently in arm64's copy_{to,from}_user, we only check the
source/destination object size if access_ok() tells us the user access
is permissible.

However, in copy_from_user() we'll subsequently zero any remainder on
the destination object. If we failed the access_ok() check, that applies
to the whole object size, which we didn't check.

To ensure that we catch that case, this patch hoists check_object_size()
to the start of copy_from_user(), matching __copy_from_user() and
__copy_to_user(). To make all of our uaccess copy primitives consistent,
the same is done to copy_to_user().

Change-Id: I89bb8ab6e45d1fd28a7e188181b3742a2b9060d8
Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Git-commit: 76624175dcae6f7a808d345c0592908a15ca6975
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
parent d98d9ee8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment