metag/usercopy: Add early abort to copy_to_user
authorJames Hogan <james.hogan@imgtec.com>
Fri, 31 Mar 2017 12:35:01 +0000 (13:35 +0100)
committerJiri Slaby <jslaby@suse.cz>
Wed, 26 Apr 2017 18:05:01 +0000 (20:05 +0200)
commit16bcddbe3c1b721d7851178005c8af01fa20230b
tree1fefb69165ce53229114913a58ec0c27f7bc3f1e
parente7ef4a6c0e90b122c1e31ccf8284793e76987658
metag/usercopy: Add early abort to copy_to_user

commit fb8ea062a8f2e85256e13f55696c5c5f0dfdcc8b upstream.

When copying to userland on Meta, if any faults are encountered
immediately abort the copy instead of continuing on and repeatedly
faulting, and worse potentially copying further bytes successfully to
subsequent valid pages.

Fixes: 373cd784d0fc ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/metag/lib/usercopy.c