]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Fix potential infoleak in older kernels
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Nov 2016 10:17:00 +0000 (11:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 22:33:04 +0000 (23:33 +0100)
Not upstream as it is not needed there.

So a patch something like this might be a safe way to fix the
potential infoleak in older kernels.

THIS IS UNTESTED. It's a very obvious patch, though, so if it compiles
it probably works. It just initializes the output variable with 0 in
the inline asm description, instead of doing it in the exception
handler.

It will generate slightly worse code (a few unnecessary ALU
operations), but it doesn't have any interactions with the exception
handler implementation.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/x86/include/asm/uaccess.h

index 5ee26875baea3a5676d727ef6a67d98811094a33..995c49aa1a19b0dd0e7cb243c37f37713b666c42 100644 (file)
@@ -381,7 +381,7 @@ do {                                                                        \
        asm volatile("1:        mov"itype" %1,%"rtype"0\n"              \
                     "2:\n"                                             \
                     _ASM_EXTABLE_EX(1b, 2b)                            \
-                    : ltype(x) : "m" (__m(addr)))
+                    : ltype(x) : "m" (__m(addr)), "0" (0))
 
 #define __put_user_nocheck(x, ptr, size)                       \
 ({                                                             \