[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170816221823.fzewgtfijqh4jfdn@node.shutemov.name>
Date: Thu, 17 Aug 2017 01:18:23 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Alexander Potapenko <glider@...gle.com>
Cc: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/boot/64: clang: use fixup_pointer() to access
next_early_pgt
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@...ux.intel.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Cc: Dmitry Vyukov <dvyukov@...gle.com>
> Cc: Michael Davidson <md@...gle.com>
> Fixes: c88d71508e36 ("x86/boot/64: Rewrite startup_64() in C")
Cc: <stable@...r.kernel.org> # 4.12
--
Kirill A. Shutemov
Powered by blists - more mailing lists