]> git.hungrycats.org Git - linux/commitdiff
MIPS: Zero variable read by get_user / __get_user in case of an error.
authorRalf Baechle <ralf@linux-mips.org>
Tue, 18 Nov 2014 17:47:13 +0000 (18:47 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 4 Apr 2017 21:21:56 +0000 (22:21 +0100)
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>
arch/mips/include/asm/uaccess.h

index cb4a3ee31983fe117b5b7a2d9f39a27ff64d790a..a752de97840f0e524d6defae1d67f49a0d3b9934 100644 (file)
@@ -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"     \