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)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:47:07 +0000 (00:47 +0200)
commit9a83add8a964a6ccb9da9094856b702049c46173
treed238abdc0ad84538d3593aadf7d1e8ddf578387c
parent994c8e5af5c712ad6132fccbbea2ebf7dbabfe02
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>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/metag/lib/usercopy.c