]> git.baikalelectronics.ru Git - kernel.git/commit
x86/boot/64: Add missing fixup_pointer() for next_early_pgt access
authorKirill A. Shutemov <kirill@shutemov.name>
Thu, 20 Jun 2019 11:24:22 +0000 (14:24 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 26 Jun 2019 05:25:09 +0000 (07:25 +0200)
commit8d692997ca392ce244e522a31cee0400cfe0dbbf
tree10d2d9983d82d6c9cfabe6b08cfdb28032707730
parentcaf21fe00d7bb7160cb061c1eb9789fc9dd51496
x86/boot/64: Add missing fixup_pointer() for next_early_pgt access

__startup_64() uses fixup_pointer() to access global variables in a
position-independent fashion. Access to next_early_pgt was wrapped into the
helper, but one instance in the 5-level paging branch was missed.

GCC generates a R_X86_64_PC32 PC-relative relocation for the access which
doesn't trigger the issue, but Clang emmits a R_X86_64_32S which leads to
an invalid memory access and system reboot.

Fixes: 3156983b6113 ("x86/boot/64/clang: Use fixup_pointer() to access 'next_early_pgt'")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alexander Potapenko <glider@google.com>
Link: https://lkml.kernel.org/r/20190620112422.29264-1-kirill.shutemov@linux.intel.com
arch/x86/kernel/head64.c