]> git.itanic.dy.fi Git - linux-stable/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Apr 2017 05:15:06 +0000 (07:15 +0200)
commit753c05dc2f0842711677f616fd740230b8959a69
tree167f0942f2d4c8e8da010377efdb784a06ca77de
parent63916ca6f09540e0166136f0ef407c60acf21541
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/metag/lib/usercopy.c