]> git.baikalelectronics.ru Git - kernel.git/commit
xtensa: fix {get,put}_user() for 64bit values
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 9 Oct 2019 19:21:05 +0000 (20:21 +0100)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 14 Oct 2019 18:39:50 +0000 (11:39 -0700)
commitbcd1ebf40fc76d75b3e5afe119f9b91dde29ecb6
tree91dfc29dc79a7a8d7e33df00b784e36ac5597b0b
parent1eba4f95a783c5666881b1e9b4c3de4b05c4f502
xtensa: fix {get,put}_user() for 64bit values

First of all, on short copies __copy_{to,from}_user() return the amount
of bytes left uncopied, *not* -EFAULT.  get_user() and put_user() are
expected to return -EFAULT on failure.

Another problem is get_user(v32, (__u64 __user *)p); that should
fetch 64bit value and the assign it to v32, truncating it in process.
Current code, OTOH, reads 8 bytes of data and stores them at the
address of v32, stomping on the 4 bytes that follow v32 itself.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/uaccess.h