]> git.baikalelectronics.ru Git - kernel.git/commit
s390/uaccess: get_user() should zero on failure (again)
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 27 Mar 2017 07:48:04 +0000 (09:48 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 30 Mar 2017 06:18:59 +0000 (08:18 +0200)
commit34de9c7f527dc01aa5319675639cfc21c2571e70
tree6bb8d0f317d621a46e39ef5a9883a22559a5c7af
parent62641dad8c593110c790d10738b5a0ed1856a962
s390/uaccess: get_user() should zero on failure (again)

Commit febc06d76493 ("s390: get_user() should zero on failure")
intended to fix s390's get_user() implementation which did not zero
the target operand if the read from user space faulted. Unfortunately
the patch has no effect: the corresponding inline assembly specifies
that the operand is only written to ("=") and the previous value is
discarded.

Therefore the compiler is free to and actually does omit the zero
initialization.

To fix this simply change the contraint modifier to "+", so the
compiler cannot omit the initialization anymore.

Fixes: 5b67943ceb48 ("s390/uaccess: provide inline variants of get_user/put_user")
Fixes: febc06d76493 ("s390: get_user() should zero on failure")
Cc: stable@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/uaccess.h