Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713372

Re: [PATCH] x86/boot/64: clang: use fixup_pointer() to access next_early_pgt

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/boot/64: clang: use fixup_pointer() to access next_early_pgt
Date 2017-08-17 00:20 +0200
Message-ID <ufePo-4ml-7@gated-at.bofh.it> (permalink)
References <ufbRw-2wV-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 09:08:08PM +0200, Alexander Potapenko wrote:
> __startup_64() is normally using fixup_pointer() to access globals in a
> position-independent fashion. However |next_early_pgt| was accessed
> directly, which wasn't guaranteed to work.
> 
> Luckily GCC was generating a R_X86_64_PC32 PC-relative relocation for
> |next_early_pgt|, but Clang emitted a R_X86_64_32S, which led to
> accessing invalid memory and rebooting the kernel.

Thanks for tracking this down.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: Michael Davidson <md@google.com>
> Fixes: c88d71508e36 ("x86/boot/64: Rewrite startup_64() in C")

Cc: <stable@vger.kernel.org> # 4.12

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/boot/64: clang: use fixup_pointer() to access next_early_pgt Alexander Potapenko <glider@google.com> - 2017-08-16 21:10 +0200
  Re: [PATCH] x86/boot/64: clang: use fixup_pointer() to access next_early_pgt Alexander Potapenko <glider@google.com> - 2017-08-16 21:20 +0200
  Re: [PATCH] x86/boot/64: clang: use fixup_pointer() to access  next_early_pgt "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-17 00:20 +0200
  [tip:x86/urgent] x86/boot/64/clang: Use fixup_pointer() to access  'next_early_pgt' tip-bot for Alexander Potapenko <tipbot@zytor.com> - 2017-08-17 12:30 +0200

csiph-web