android_kernel_lge_bullhead/arch/metag/lib
James Hogan aaf47bf25e metag/usercopy: Zero rest of buffer from copy_from_user
commit 563ddc1076109f2b3f88e6d355eab7b6fd4662cb upstream.

Currently we try to zero the destination for a failed read from userland
in fixup code in the usercopy.c macros. The rest of the destination
buffer is then zeroed from __copy_user_zeroing(), which is used for both
copy_from_user() and __copy_from_user().

Unfortunately we fail to zero in the fixup code as D1Ar1 is set to 0
before the fixup code entry labels, and __copy_from_user() shouldn't even
be zeroing the rest of the buffer.

Move the zeroing out into copy_from_user() and rename
__copy_user_zeroing() to raw_copy_from_user() since it no longer does
any zeroing. This also conveniently matches the name needed for
RAW_COPY_USER support in a later patch.

Fixes: 373cd784d0 ("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>
2017-06-20 14:04:43 +02:00
..
Makefile metag: Build infrastructure 2013-03-02 20:09:54 +00:00
ashldi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
ashrdi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
checksum.c metag: Optimised library functions 2013-03-02 20:09:52 +00:00
clear_page.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
cmpdi2.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
copy_page.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
delay.c metag: Optimised library functions 2013-03-02 20:09:52 +00:00
div64.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
divsi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
ip_fast_csum.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
lshrdi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
memcpy.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
memmove.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
memset.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
modsi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
muldi3.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
ucmpdi2.S metag: Optimised library functions 2013-03-02 20:09:52 +00:00
usercopy.c metag/usercopy: Zero rest of buffer from copy_from_user 2017-06-20 14:04:43 +02:00