From: Peter Zijlstra Subject: Re: [PATCH v9 00/11] x86: PIE support to extend KASLR randomization Date: Tue, 6 Aug 2019 17:50:34 +0200 Message-ID: <20190806155034.GP2349@hirez.programming.kicks-ass.net> References: <20190730191303.206365-1-thgarnie@chromium.org> <20190806154347.GD25897@zn.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190806154347.GD25897@zn.tnic> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Borislav Petkov Cc: Feng Tang , kristen@linux.intel.com, kernel-hardening@lists.openwall.com, "VMware, Inc." , virtualization@lists.linux-foundation.org, Thomas Garnier , Pavel Machek , "H. Peter Anvin" , Thomas Hellstrom , Herbert Xu , x86@kernel.org, Ingo Molnar , Len Brown , keescook@chromium.org, Jann Horn , Alexios Zavras , Andy Lutomirski , Thomas Gleixner , Allison Randal , Juergen Gross , Maran Wilson , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Nadav Amit List-Id: virtualization@lists.linuxfoundation.org On Tue, Aug 06, 2019 at 05:43:47PM +0200, Borislav Petkov wrote: > On Tue, Jul 30, 2019 at 12:12:44PM -0700, Thomas Garnier wrote: > > These patches make some of the changes necessary to build the kernel as > > Position Independent Executable (PIE) on x86_64. Another patchset will > > add the PIE option and larger architecture changes. > > Yeah, about this: do we have a longer writeup about the actual benefits > of all this and why we should take this all? After all, after looking > at the first couple of asm patches, it is posing restrictions to how > we deal with virtual addresses in asm (only RIP-relative addressing in > 64-bit mode, MOVs with 64-bit immediates, etc, for example) and I'm > willing to bet money that some future unrelated change will break PIE > sooner or later. Possibly objtool can help here; it should be possible to teach it about these rules, and then it will yell when violated. That should avoid regressions.