diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2016-09-15 02:35:29 +0100 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-10-05 22:40:20 -0400 |
commit | e58d9a8251584d92976d4cc7f46ab30963c9e99a (patch) | |
tree | 580d690c92b26c0b0d82d796e97b587e6e9717ee | |
parent | 0772cbae23cefb135c5214aed8631b344f791a43 (diff) | |
download | lwn-e58d9a8251584d92976d4cc7f46ab30963c9e99a.tar.gz lwn-e58d9a8251584d92976d4cc7f46ab30963c9e99a.zip |
fix minor infoleak in get_user_ex()
[ Upstream commit 1c109fabbd51863475cd12ac206bdd249aee35af ]
get_user_ex(x, ptr) should zero x on failure. It's not a lot of a leak
(at most we are leaking uninitialized 64bit value off the kernel stack,
and in a fairly constrained situation, at that), but the fix is trivial,
so...
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ This sat in different branch from the uaccess fixes since mid-August ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | arch/x86/include/asm/uaccess.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index 0d592e0a5b84..8e046ade1c88 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -391,7 +391,11 @@ do { \ #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \ asm volatile("1: mov"itype" %1,%"rtype"0\n" \ "2:\n" \ - _ASM_EXTABLE_EX(1b, 2b) \ + ".section .fixup,\"ax\"\n" \ + "3:xor"itype" %"rtype"0,%"rtype"0\n" \ + " jmp 2b\n" \ + ".previous\n" \ + _ASM_EXTABLE_EX(1b, 3b) \ : ltype(x) : "m" (__m(addr))) #define __put_user_nocheck(x, ptr, size) \ |