x86/fsgsbase/64: Report FSBASE and GSBASE correctly in core dumps
authorAndy Lutomirski <luto@kernel.org>
Tue, 1 Aug 2017 14:11:35 +0000 (07:11 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 10 Aug 2017 15:15:13 +0000 (17:15 +0200)
commit9584d98bed7a7a904d0702ad06bbcc94703cb5b4
tree3c89ecd9fbd72c4e3bf90e45d1bbf79281edfbfc
parent767d035d838f4fd6b5a5bbd7a3f6d293b7f65a49
x86/fsgsbase/64: Report FSBASE and GSBASE correctly in core dumps

In ELF_COPY_CORE_REGS, we're copying from the current task, so
accessing thread.fsbase and thread.gsbase makes no sense.  Just read
the values from the CPU registers.

In practice, the old code would have been correct most of the time
simply because thread.fsbase and thread.gsbase usually matched the
CPU registers.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Chang Seok <chang.seok.bae@intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/elf.h