summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-11-18 18:47:13 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-04-04 22:21:56 +0100
commit4c125b48deacb51dbe5618ba5c1cfec9bcc41e6e (patch)
tree4da09016c2e16c189a5d4ea4ad0349b845312a3e
parentcfe5ef4021ed81be0a3117a956f31fc545d0df8d (diff)
MIPS: Zero variable read by get_user / __get_user in case of an error.
commit 640465bda58c7078725201be7430c31a349121e9 upstream. This wasn't happening in all cases. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/mips/include/asm/uaccess.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index cb4a3ee31983..a752de97840f 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -302,7 +302,8 @@ do { \
__get_kernel_common((x), size, __gu_ptr); \
else \
__get_user_common((x), size, __gu_ptr); \
- } \
+ } else \
+ (x) = 0; \
\
__gu_err; \
})
@@ -317,6 +318,7 @@ do { \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"3: li %0, %4 \n" \
+ " move %1, $0 \n" \
" j 2b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \
@@ -631,6 +633,7 @@ do { \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"3: li %0, %4 \n" \
+ " move %1, $0 \n" \
" j 2b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \